Display the different tool calls we need to do

This commit is contained in:
Clément Renault 2025-05-15 11:17:34 +02:00
parent e0c8c11a94
commit 6329cf7ed6
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -374,6 +374,16 @@ async fn streamed_chat(
);
for call in meili_calls {
tx.send(Event::Data(
sse::Data::new_json(&json!({
"object": "chat.completion.tool.call",
"tool": call,
}))
.unwrap(),
))
.await
.unwrap();
let SearchInIndexParameters { index_uid, q } =
serde_json::from_str(&call.function.arguments).unwrap();
@ -448,7 +458,7 @@ async fn streamed_chat(
);
tx.send(Event::Data(
sse::Data::new_json(&json!({
"object": "chat.completion.tool.event",
"object": "chat.completion.tool.output",
"tool": tool,
}))
.unwrap(),