mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-06-06 20:25:40 +00:00
Display the different tool calls we need to do
This commit is contained in:
parent
59873fdc6c
commit
d94f16b1d2
@ -374,6 +374,16 @@ async fn streamed_chat(
|
|||||||
);
|
);
|
||||||
|
|
||||||
for call in meili_calls {
|
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 } =
|
let SearchInIndexParameters { index_uid, q } =
|
||||||
serde_json::from_str(&call.function.arguments).unwrap();
|
serde_json::from_str(&call.function.arguments).unwrap();
|
||||||
|
|
||||||
@ -448,7 +458,7 @@ async fn streamed_chat(
|
|||||||
);
|
);
|
||||||
tx.send(Event::Data(
|
tx.send(Event::Data(
|
||||||
sse::Data::new_json(&json!({
|
sse::Data::new_json(&json!({
|
||||||
"object": "chat.completion.tool.event",
|
"object": "chat.completion.tool.output",
|
||||||
"tool": tool,
|
"tool": tool,
|
||||||
}))
|
}))
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user