File tree Expand file tree Collapse file tree 2 files changed +21
-16
lines changed Expand file tree Collapse file tree 2 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -57,12 +57,12 @@ pub async fn generate_proposals(
5757 model : & str ,
5858) -> Result < Vec < String > , anyhow:: Error > {
5959 let prompt = ORCHESTRATOR_PROMPT . replace ( "{query}" , query) ;
60-
60+
6161 // Debug: Write the prompt to a file so we can see what's being sent
6262 std:: fs:: write ( "/tmp/debug_prompt.txt" , & prompt) . ok ( ) ;
63-
63+
6464 let response_str = call_local_model ( endpoint, model, & prompt) . await ?;
65-
65+
6666 // Debug: Write the response to a file so we can see what came back
6767 std:: fs:: write ( "/tmp/debug_response.txt" , & response_str) . ok ( ) ;
6868
@@ -74,11 +74,18 @@ pub async fn generate_proposals(
7474 Err ( e) => {
7575 // Debug: Write the JSON we tried to parse
7676 std:: fs:: write ( "/tmp/debug_json.txt" , json_str) . ok ( ) ;
77- Err ( anyhow:: anyhow!( "Failed to parse proposals JSON: {} | JSON: {}" , e, json_str) )
78- } ,
77+ Err ( anyhow:: anyhow!(
78+ "Failed to parse proposals JSON: {} | JSON: {}" ,
79+ e,
80+ json_str
81+ ) )
82+ }
7983 }
8084 } else {
81- Err ( anyhow:: anyhow!( "No JSON object found in model response: {}" , response_str) )
85+ Err ( anyhow:: anyhow!(
86+ "No JSON object found in model response: {}" ,
87+ response_str
88+ ) )
8289 }
8390}
8491
Original file line number Diff line number Diff line change @@ -170,10 +170,11 @@ impl App {
170170 }
171171
172172 // Header text
173- let header = Paragraph :: new ( "Ruixen has a few lines of inquiry. Select the best one to pursue:" )
174- . alignment ( Alignment :: Left )
175- . style ( self . theme . ratatui_style ( Element :: Text ) )
176- . wrap ( Wrap { trim : true } ) ;
173+ let header =
174+ Paragraph :: new ( "Ruixen has a few lines of inquiry. Select the best one to pursue:" )
175+ . alignment ( Alignment :: Left )
176+ . style ( self . theme . ratatui_style ( Element :: Text ) )
177+ . wrap ( Wrap { trim : true } ) ;
177178
178179 // Split area: header + proposals + footer
179180 let chunks = Layout :: default ( )
@@ -196,13 +197,10 @@ impl App {
196197 let is_selected = i == self . current_proposal_index ;
197198 let prefix = if is_selected { "> " } else { " " } ;
198199 let number = format ! ( "{}. " , i + 1 ) ;
199-
200+
200201 // Split proposal into sentences (max 2) and wrap
201- let sentences: Vec < & str > = proposal
202- . split ( ". " )
203- . take ( 2 )
204- . collect ( ) ;
205-
202+ let sentences: Vec < & str > = proposal. split ( ". " ) . take ( 2 ) . collect ( ) ;
203+
206204 let proposal_text = if sentences. len ( ) > 1 {
207205 format ! ( "{} {}" , sentences[ 0 ] , sentences. get( 1 ) . unwrap_or( & "" ) )
208206 } else {
You can’t perform that action at this time.
0 commit comments