Skip to content

Commit b8a98cc

Browse files
committed
optimize the prompt
Signed-off-by: kerthcet <kerthcet@gmail.com>
1 parent eaceb5f commit b8a98cc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/cli/chat.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ pub async fn interactive_chat<E: InferenceEngine>(
6868
let input = match readline {
6969
Ok(line) => line.trim().to_string(),
7070
Err(ReadlineError::Interrupted) | Err(ReadlineError::Eof) => {
71-
println!("\nGoodbye!");
7271
break;
7372
}
7473
Err(err) => {
@@ -81,7 +80,6 @@ pub async fn interactive_chat<E: InferenceEngine>(
8180
continue;
8281
}
8382
if input == "exit" {
84-
println!("Goodbye!");
8583
break;
8684
}
8785

@@ -91,6 +89,9 @@ pub async fn interactive_chat<E: InferenceEngine>(
9189
// Build prompt from conversation history
9290
let prompt = conversation_history.join("\n") + "\nAssistant:";
9391

92+
// Empty line before response
93+
println!();
94+
9495
// Generate response with streaming
9596
match engine.generate_stream(model, &prompt, 512, 0.7).await {
9697
Ok(mut stream) => {

0 commit comments

Comments
 (0)