@petrgrishin/ai-sdk-ollama 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1935,6 +1935,18 @@ var OllamaChatLanguageModel = class {
1935
1935
  id: currentTextId
1936
1936
  });
1937
1937
  }
1938
+ if (chunk.message && chunk.message.tool_calls && chunk.message.tool_calls.length > 0) {
1939
+ hasToolCalls = true;
1940
+ for (const toolCall of chunk.message.tool_calls) {
1941
+ const toolInput = toolCall.function.arguments || {};
1942
+ controller.enqueue({
1943
+ type: "tool-call",
1944
+ toolCallId: crypto.randomUUID(),
1945
+ toolName: toolCall.function.name,
1946
+ input: JSON.stringify(toolInput)
1947
+ });
1948
+ }
1949
+ }
1938
1950
  usage = createUsage(
1939
1951
  chunk.prompt_eval_count ?? void 0,
1940
1952
  chunk.eval_count ?? void 0