ai 6.0.250 → 6.0.252

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.
@@ -164,7 +164,7 @@ function detectMediaType({
164
164
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
165
165
 
166
166
  // src/version.ts
167
- var VERSION = true ? "6.0.250" : "0.0.0-test";
167
+ var VERSION = true ? "6.0.252" : "0.0.0-test";
168
168
 
169
169
  // src/util/download/download.ts
170
170
  var download = async ({
@@ -144,7 +144,7 @@ import {
144
144
  } from "@ai-sdk/provider-utils";
145
145
 
146
146
  // src/version.ts
147
- var VERSION = true ? "6.0.250" : "0.0.0-test";
147
+ var VERSION = true ? "6.0.252" : "0.0.0-test";
148
148
 
149
149
  // src/util/download/download.ts
150
150
  var download = async ({
@@ -112,6 +112,7 @@ Here are the capabilities of popular models:
112
112
 
113
113
  | Provider | Model | Image Input | Object Generation | Tool Usage | Tool Streaming |
114
114
  | -------------------------------------------------- | ------------------------------------------- | ------------------- | ------------------- | ------------------- | ------------------- |
115
+ | [xAI Grok](/providers/ai-sdk-providers/xai) | `grok-4.6` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
115
116
  | [xAI Grok](/providers/ai-sdk-providers/xai) | `grok-4.5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
116
117
  | [xAI Grok](/providers/ai-sdk-providers/xai) | `grok-4` | <Cross size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
117
118
  | [xAI Grok](/providers/ai-sdk-providers/xai) | `grok-3` | <Cross size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "6.0.250",
3
+ "version": "6.0.252",
4
4
  "description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@opentelemetry/api": "^1.9.0",
48
- "@ai-sdk/gateway": "3.0.170",
48
+ "@ai-sdk/gateway": "3.0.171",
49
49
  "@ai-sdk/provider": "3.0.15",
50
50
  "@ai-sdk/provider-utils": "4.0.45"
51
51
  },
@@ -202,6 +202,7 @@ export type ToolLoopAgentSettings<
202
202
  | 'frequencyPenalty'
203
203
  | 'stopSequences'
204
204
  | 'seed'
205
+ | 'timeout'
205
206
  | 'headers'
206
207
  | 'instructions'
207
208
  | 'allowSystemInMessages'
@@ -143,10 +143,12 @@ export class ToolLoopAgent<
143
143
  }: AgentCallParameters<CALL_OPTIONS, TOOLS>): Promise<
144
144
  GenerateTextResult<TOOLS, OUTPUT>
145
145
  > {
146
+ const preparedCall = await this.prepareCall(options);
147
+
146
148
  return generateText({
147
- ...(await this.prepareCall(options)),
149
+ ...preparedCall,
148
150
  abortSignal,
149
- timeout,
151
+ timeout: timeout ?? preparedCall.timeout,
150
152
  onStepFinish: this.mergeOnStepFinishCallbacks(onStepFinish),
151
153
  });
152
154
  }
@@ -163,10 +165,12 @@ export class ToolLoopAgent<
163
165
  }: AgentStreamParameters<CALL_OPTIONS, TOOLS>): Promise<
164
166
  StreamTextResult<TOOLS, OUTPUT>
165
167
  > {
168
+ const preparedCall = await this.prepareCall(options);
169
+
166
170
  return streamText({
167
- ...(await this.prepareCall(options)),
171
+ ...preparedCall,
168
172
  abortSignal,
169
- timeout,
173
+ timeout: timeout ?? preparedCall.timeout,
170
174
  experimental_transform,
171
175
  onStepFinish: this.mergeOnStepFinishCallbacks(onStepFinish),
172
176
  });
@@ -51,5 +51,5 @@ export type Provider = {
51
51
  *
52
52
  * @throws {NoSuchModelError} If no such model exists.
53
53
  */
54
- rerankingModel(modelId: string): RerankingModel;
54
+ rerankingModel?(modelId: string): RerankingModel;
55
55
  };
package/src/ui/chat.ts CHANGED
@@ -846,15 +846,13 @@ export abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
846
846
  finishReason: activeResponse.state.finishReason,
847
847
  });
848
848
  }
849
- } catch (err) {
850
- console.error(err);
851
- }
849
+ } finally {
850
+ if (this.activeResponse === activeResponse) {
851
+ this.activeResponse = undefined;
852
+ }
852
853
 
853
- if (this.activeResponse === activeResponse) {
854
- this.activeResponse = undefined;
854
+ clearActiveResumeRequest();
855
855
  }
856
-
857
- clearActiveResumeRequest();
858
856
  }
859
857
 
860
858
  // automatically send the message if the sendAutomaticallyWhen function returns true