mirror of
https://github.com/sigoden/aichat
synced 2024-11-18 09:28:27 +00:00
fix: infinite loop of function calls on poor LLM (#585)
This commit is contained in:
parent
b05b730cb5
commit
aa94fb2f83
@ -28,6 +28,9 @@ pub fn eval_tool_calls(
|
||||
return Ok(output);
|
||||
}
|
||||
calls = ToolCall::dedup(calls);
|
||||
if calls.is_empty() {
|
||||
bail!("The request was aborted because an infinite loop of function calls was detected.")
|
||||
}
|
||||
for call in calls {
|
||||
let result = call.eval(config)?;
|
||||
output.push(ToolCallResult::new(call, result));
|
||||
|
Loading…
Reference in New Issue
Block a user