ai-sdk-ollama 4.5.0 → 4.5.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - cc1d4f7: Report `finishReason: 'length'` when Ollama truncates a response that contains tool calls. Before this fix the provider reported `tool-calls`, so the AI SDK ran tools from a cut-off turn (#1092).
8
+
3
9
  ## 4.5.0
4
10
 
5
11
  ### Minor Changes
@@ -1702,7 +1702,7 @@ function cleanSchemaForOllama(schema) {
1702
1702
 
1703
1703
  // src/utils/map-ollama-finish-reason.ts
1704
1704
  function mapOllamaFinishReason(reason, hasToolCalls = false) {
1705
- if (hasToolCalls) {
1705
+ if (hasToolCalls && reason !== "length") {
1706
1706
  return {
1707
1707
  unified: "tool-calls",
1708
1708
  raw: reason || void 0