11use crate :: PromptFormat ;
22use crate :: example:: { ActualExcerpt , ExpectedExcerpt , NamedExample } ;
33use crate :: headless:: ZetaCliAppState ;
4- use crate :: paths:: { CACHE_DIR , LOGS_DIR } ;
4+ use crate :: paths:: {
5+ CACHE_DIR , LOGS_DIR , LOGS_PREDICTION_PROMPT , LOGS_PREDICTION_RESPONSE , LOGS_SEARCH_PROMPT ,
6+ LOGS_SEARCH_QUERIES ,
7+ } ;
58use :: serde:: Serialize ;
69use anyhow:: { Result , anyhow} ;
710use clap:: Args ;
@@ -61,6 +64,15 @@ pub async fn run_zeta2_predict(
6164 . await
6265 . unwrap ( ) ;
6366 result. write ( args. format , std:: io:: stdout ( ) ) . unwrap ( ) ;
67+
68+ println ! ( "## Logs\n " ) ;
69+ println ! ( "Search prompt: {}" , LOGS_SEARCH_PROMPT . display( ) ) ;
70+ println ! ( "Search queries: {}" , LOGS_SEARCH_QUERIES . display( ) ) ;
71+ println ! ( "Prediction prompt: {}" , LOGS_PREDICTION_PROMPT . display( ) ) ;
72+ println ! (
73+ "Prediction response: {}" ,
74+ LOGS_PREDICTION_RESPONSE . display( )
75+ ) ;
6476}
6577
6678thread_local ! {
@@ -147,12 +159,12 @@ pub async fn zeta2_predict(
147159 match event {
148160 zeta2:: ZetaDebugInfo :: ContextRetrievalStarted ( info) => {
149161 start_time = Some ( info. timestamp ) ;
150- fs:: write ( LOGS_DIR . join ( "search_prompt.md" ) , & info. search_prompt ) ?;
162+ fs:: write ( & * LOGS_SEARCH_PROMPT , & info. search_prompt ) ?;
151163 }
152164 zeta2:: ZetaDebugInfo :: SearchQueriesGenerated ( info) => {
153165 search_queries_generated_at = Some ( info. timestamp ) ;
154166 fs:: write (
155- LOGS_DIR . join ( "search_queries.json" ) ,
167+ & * LOGS_SEARCH_QUERIES ,
156168 serde_json:: to_string_pretty ( & info. search_queries ) . unwrap ( ) ,
157169 ) ?;
158170 }
@@ -164,7 +176,7 @@ pub async fn zeta2_predict(
164176 let prediction_started_at = Instant :: now ( ) ;
165177 start_time. get_or_insert ( prediction_started_at) ;
166178 fs:: write (
167- LOGS_DIR . join ( "prediction_prompt.md" ) ,
179+ & * LOGS_PREDICTION_PROMPT ,
168180 & request. local_prompt . unwrap_or_default ( ) ,
169181 ) ?;
170182
@@ -198,7 +210,7 @@ pub async fn zeta2_predict(
198210 let response = request. response_rx . await ?. 0 . map_err ( |err| anyhow ! ( err) ) ?;
199211 let response = zeta2:: text_from_response ( response) . unwrap_or_default ( ) ;
200212 let prediction_finished_at = Instant :: now ( ) ;
201- fs:: write ( LOGS_DIR . join ( "prediction_response.md" ) , & response) ?;
213+ fs:: write ( & * LOGS_PREDICTION_RESPONSE , & response) ?;
202214
203215 let mut result = result. lock ( ) . unwrap ( ) ;
204216
0 commit comments