@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.
@@ -1909,6 +1909,18 @@ var OllamaChatLanguageModel = class {
1909
1909
  id: currentTextId
1910
1910
  });
1911
1911
  }
1912
+ if (chunk.message && chunk.message.tool_calls && chunk.message.tool_calls.length > 0) {
1913
+ hasToolCalls = true;
1914
+ for (const toolCall of chunk.message.tool_calls) {
1915
+ const toolInput = toolCall.function.arguments || {};
1916
+ controller.enqueue({
1917
+ type: "tool-call",
1918
+ toolCallId: crypto.randomUUID(),
1919
+ toolName: toolCall.function.name,
1920
+ input: JSON.stringify(toolInput)
1921
+ });
1922
+ }
1923
+ }
1912
1924
  usage = createUsage(
1913
1925
  chunk.prompt_eval_count ?? void 0,
1914
1926
  chunk.eval_count ?? void 0