Skip to content

Commit 1dfaae2

Browse files
committed
Ok, just output a role: "tool" chunk
1 parent c5fbd54 commit 1dfaae2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/tiny-agents/src/lib/webServer.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,14 @@ export function startServer(agent: Agent): void {
8282
res.write(`data: ${JSON.stringify(chunk)}\n\n`);
8383
} else {
8484
/// Tool call info
85-
/// /!\ We format it as a regular chunk!
85+
/// /!\ We format it as a regular chunk of role = "tool"
8686
const chunkToolcallInfo = {
8787
choices: [
8888
{
8989
index: 0,
9090
delta: {
91-
role: "assistant",
92-
content:
93-
"<tool_call_info>" +
94-
`Tool[${chunk.name}] ${chunk.tool_call_id}\n` +
95-
chunk.content +
96-
"</tool_call_info>",
91+
role: "tool",
92+
content: `Tool[${chunk.name}] ${chunk.tool_call_id}\n` + chunk.content,
9793
},
9894
},
9995
],

0 commit comments

Comments
 (0)