Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 9e74cc9

Browse files
authored
Ensure content field is populated with tool call (#35)
* Ensure content field is populated with tool call * spacing * Add changeset
1 parent cd0b04c commit 9e74cc9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/rude-buttons-breathe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"workers-ai-provider": patch
3+
---
4+
5+
Ensures that tool call data is available to model, by providing the JSON of the tool call as the content in the assistant message.

packages/ai-provider/src/convert-to-workersai-chat-messages.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ export function convertToWorkersAIChatMessages(
5353
break;
5454
}
5555
case "tool-call": {
56+
text = JSON.stringify({ name: part.toolName, parameters: part.args });
57+
5658
toolCalls.push({
5759
id: part.toolCallId,
5860
type: "function",

0 commit comments

Comments
 (0)