mirror of https://github.com/buster-so/buster.git
ok streaming it back
This commit is contained in:
parent
8c8372b50e
commit
118ef9c691
|
@ -424,31 +424,26 @@ impl Agent {
|
||||||
for tool_call in tool_calls {
|
for tool_call in tool_calls {
|
||||||
pending.update_from_delta(tool_call);
|
pending.update_from_delta(tool_call);
|
||||||
|
|
||||||
// Only send intermediate updates if we have a function name
|
// Send an update if we have a name, regardless of arguments
|
||||||
if let Some(name) = &pending.function_name {
|
if let Some(name) = &pending.function_name {
|
||||||
if !pending.arguments.trim().is_empty() {
|
let temp_tool_call = ToolCall {
|
||||||
let temp_tool_call = ToolCall {
|
id: pending.id.clone().unwrap_or_default(),
|
||||||
id: pending.id.clone().unwrap_or_default(),
|
function: FunctionCall {
|
||||||
function: FunctionCall {
|
name: name.clone(),
|
||||||
name: name.clone(),
|
arguments: pending.arguments.clone(),
|
||||||
arguments: pending.arguments.clone(),
|
},
|
||||||
},
|
call_type: pending.call_type.clone().unwrap_or_default(),
|
||||||
call_type: pending
|
code_interpreter: None,
|
||||||
.call_type
|
retrieval: None,
|
||||||
.clone()
|
};
|
||||||
.unwrap_or_default(),
|
|
||||||
code_interpreter: None,
|
|
||||||
retrieval: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
let _ = tx
|
let _ = tx
|
||||||
.send(Ok(Message::assistant(
|
.send(Ok(Message::assistant(
|
||||||
None,
|
None,
|
||||||
Some(vec![temp_tool_call]),
|
Some(vec![temp_tool_call]),
|
||||||
Some(MessageProgress::InProgress),
|
Some(MessageProgress::InProgress),
|
||||||
)))
|
)))
|
||||||
.await;
|
.await;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue