
    ,i&                        d Z ddlZddlmc mZ ddlZddlZddl	m
Z
 ej                  j                  d e e
e      j                               ddlmZ  e
e      j                  dz  Zd Zedk(  r ej*                   e              yy)z
Test runner for one_minute_history with updated prompt and fixed evaluator.
Uses the Bernays/tobacco premise that was already researched.
    N)Path)run_video_generation_chainoutputc            	         t         dz  } | j                         st        d|         yt        |       5 }t	        j
                  |      }d d d        t        d       t        d       t        d       t        dj                  dd              t        d	t        |j                  d
d      j                                       t        d       t                t        |ddd      }t                t        d       t        d       t        d       d|v r3|d   }t        d|j                  dd              t        d|j                  dd              d|v r|d   }t        d       t        d|j                  dd              t        d|j                  dd              t        d|j                  dd              |j                  d      rt        d|j                  d d              d!|v rQt        d"       |d!   j                         D ]0  \  }}t        |t              sd#|v st        d$| d%|d#   d&       2 d'|v r5|d'   }|j                  d(i       }	t        d)|	j                  d*d              t        d+       t         dz  }
|
j                         rVt        |
j                  d,      d-.      }t        d/t        |       d0       |d d1 D ]  }t        d2|j                           y3# 1 sw Y   xY w)4Nz$layer4_input_one_minute_history.jsonz[ERROR] Input file not found:    zF======================================================================zONE MINUTE HISTORY TESTz	Premise: premisezN/AzResearch words: research_report_content one_minute_historyv4Z   )opportunity
channel_idprompt_versiontarget_durationRESULTSlayer4_evaluationz	Verdict: verdictzComposite Score: composite_score	gut_checkz
Gut Check:z  Would stop scrolling: would_stop_scrollingz  Would watch to end: would_watch_to_endz  Would send to someone: would_send_to_someonediscrepancy_with_scorez  DISCREPANCY: discrepancy_explanationdomain_scoresz
Domain Scores:domain_averagez  z: z.2fscriptmetadataz
Script word count: 
word_countz1
Output auto-saved to: output/one_minute_history/z*.jsonT)reversezChannel folder contains z
 video(s):   z  - r   )
OUTPUT_DIRexistsprintopenjsonloadgetlensplitr   items
isinstancedictsortedglobname)
input_filefr   result	eval_datagcdomaindatar   metachannel_dirfiless               E/home/sietch6/trending-topics-pipeline/run_one_minute_history_test.pymainr=      s   DDJ.zl;<	j	 #Qiil# 
(O	
#$	(O	Ikooi78
9:	S1JB!O!U!U!WXY
Z[	(O	G ('	F 
G	(O	)	(O f$./		)--	59:;<!)--0A5"I!JKL )#;'BL",RVV4JE-R,STU*2662F+N*OPQ-bff5Le.T-UVWvv.//H%(P'QRS i'$& )/ : @ @ B GdD).>$.FBvhb.>)?(DEFG 6!zz*b)%dhh|U&C%DEF 
>@ 33K{''14@(UJ?@r 	#AD/"	# E# #s   LL__main__)__doc__builtins@py_builtins_pytest.assertion.rewrite	assertionrewrite
@pytest_arr'   syspathlibr   pathinsertstr__file__parentvideo_generationr   r#   r=   __name__exit     r<   <module>rR      sy   
   
  3tH~,,- . 7(^""X-
JZ zCHHTV rQ   