@ai-sdk/provider-utils 5.0.62 → 5.0.64

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider-utils",
3
- "version": "5.0.62",
3
+ "version": "5.0.64",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -42,7 +42,7 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@ai-sdk/provider": "4.0.29",
45
+ "@ai-sdk/provider": "4.0.31",
46
46
  "@standard-schema/spec": "^1.1.0",
47
47
  "@workflow/serde": "4.1.0",
48
48
  "eventsource-parser": "^3.0.8",
@@ -51,6 +51,7 @@
51
51
  "devDependencies": {
52
52
  "@types/node": "22.19.19",
53
53
  "@vercel/ai-tsconfig": "0.0.0",
54
+ "@vercel/ai-tsdown-config": "0.0.0",
54
55
  "msw": "2.7.0",
55
56
  "tsdown": "^0.23.0",
56
57
  "typescript": "6.0.3",
@@ -62,6 +62,8 @@ export class DecisionLanguageModel implements DecisionModelV4 {
62
62
  async doDecide({
63
63
  state,
64
64
  questions,
65
+ maxOutputTokens,
66
+ reasoning,
65
67
  abortSignal,
66
68
  headers,
67
69
  providerOptions,
@@ -148,7 +150,8 @@ export class DecisionLanguageModel implements DecisionModelV4 {
148
150
  ]),
149
151
  );
150
152
  const result = await this.model.doGenerate({
151
- reasoning: 'none',
153
+ reasoning: reasoning ?? 'none',
154
+ maxOutputTokens,
152
155
  prompt: [
153
156
  {
154
157
  role: 'system',
@@ -79,7 +79,14 @@ export async function readResponseWithSizeLimit({
79
79
  });
80
80
  }
81
81
 
82
- chunks.push(value);
82
+ // A small chunk can keep a much larger backing buffer alive. Copy such
83
+ // views before retaining them. Unlike Uint8Array, Node Buffer's slice()
84
+ // returns another view, so use the Uint8Array constructor to copy.
85
+ chunks.push(
86
+ value.byteLength < value.buffer.byteLength
87
+ ? new Uint8Array(value)
88
+ : value,
89
+ );
83
90
  }
84
91
  } finally {
85
92
  try {