ai-sdk-ollama 4.6.0 → 4.6.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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f472ffd: Abort the Ollama request when the stream returned by `doStream` is cancelled, so the server stops generating once the consumer stops reading.
8
+ - 1645fac: Fall back to the default embedding reranking batch size when a supplied value would round down to zero, preventing repeated empty embedding requests.
9
+
3
10
  ## 4.6.0
4
11
 
5
12
  ### Minor Changes
@@ -2580,6 +2580,9 @@ var OllamaChatLanguageModel = class {
2580
2580
  } catch (error62) {
2581
2581
  controller.error(error62);
2582
2582
  }
2583
+ },
2584
+ cancel() {
2585
+ stream.abort();
2583
2586
  }
2584
2587
  });
2585
2588
  return {
@@ -22524,7 +22527,7 @@ var OllamaEmbeddingRerankingModel = class {
22524
22527
  */
22525
22528
  get embeddingBatchSize() {
22526
22529
  const { maxBatchSize } = this.settings;
22527
- if (typeof maxBatchSize === "number" && Number.isFinite(maxBatchSize) && maxBatchSize > 0) {
22530
+ if (typeof maxBatchSize === "number" && Number.isFinite(maxBatchSize) && maxBatchSize >= 1) {
22528
22531
  return Math.floor(maxBatchSize);
22529
22532
  }
22530
22533
  return 16;