fix a looping error in iterations
This commit is contained in:
@@ -1086,11 +1086,15 @@ The tool will execute immediately and you'll receive the result (success or erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
if chunk.finished {
|
if chunk.finished {
|
||||||
// Stream finished naturally without tool calls
|
// Stream finished - check if we should continue or return
|
||||||
full_response.push_str(¤t_response);
|
if !tool_executed {
|
||||||
println!();
|
// No tools were executed in this iteration, we're done
|
||||||
let ttft = first_token_time.unwrap_or_else(|| stream_start.elapsed());
|
full_response.push_str(¤t_response);
|
||||||
return Ok((full_response, ttft));
|
println!();
|
||||||
|
let ttft = first_token_time.unwrap_or_else(|| stream_start.elapsed());
|
||||||
|
return Ok((full_response, ttft));
|
||||||
|
}
|
||||||
|
break; // Tool was executed, break to continue outer loop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user