@mastra/ai-sdk 1.11.2 → 1.11.3-alpha.0

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.
@@ -189,6 +189,7 @@ declare namespace _ai_sdk_provider_utils {
189
189
  createStatusCodeErrorResponseHandler,
190
190
  delay,
191
191
  dynamicTool,
192
+ encodePathSegment,
192
193
  executeTool,
193
194
  extractResponseHeaders,
194
195
  fetchWithValidatedEndpoint,
@@ -269,6 +270,36 @@ export declare class AISDKError extends Error {
269
270
  protected static hasMarker(error: unknown, marker: string): boolean;
270
271
  }
271
272
 
273
+ /**
274
+ * AnyValue can be:
275
+ * - a string, number, boolean value
276
+ * - a byte array (Uint8Array)
277
+ * - array of any value
278
+ * - map from string to any value (a plain Object)
279
+ * - null (an empty value)
280
+ *
281
+ * https://opentelemetry.io/docs/specs/otel/common/#anyvalue
282
+ *
283
+ * Notable JavaScript types that are excluded:
284
+ * - `undefined` - Excluding this means the common practice in instrumentations,
285
+ * using `undefined` to mean "no value for this optional attribute", can
286
+ * remain supported.
287
+ * - `BigInt`
288
+ * - TypedArrays other than `Uint8Array`
289
+ * - subclasses of Object, e.g. Date, Error
290
+ *
291
+ * The TypeScript type `unknown` is used for `AnyValue`. This has some
292
+ * implications:
293
+ * - Callers of `@opentelemetry/api` APIs using `AnyValue` can pass in
294
+ * whatever type. This was always the case for (untyped) JavaScript usage.
295
+ * - SDK implementations of `@opentelemetry/api` need to document if/when they
296
+ * support a subset of AnyValue types.
297
+ * - Using `unknown` allows future changes to support more types (e.g. BigInt).
298
+ *
299
+ * @since 1.10.0
300
+ */
301
+ declare type AnyValue = unknown;
302
+
272
303
  export declare class APICallError extends AISDKError {
273
304
  private readonly [symbol$c];
274
305
  readonly url: string;
@@ -328,24 +359,20 @@ declare function asValidator<OBJECT>(value: FlexibleValidator<OBJECT>): Validato
328
359
  export declare type AsyncIterableStream<T> = AsyncIterable<T> & ReadableStream<T>;
329
360
 
330
361
  /**
331
- * Attributes is a map from string to attribute values.
332
- *
333
- * Note: only the own enumerable keys are counted as valid attribute keys.
362
+ * Attributes is a mapping from string to attribute values.
363
+ * https://opentelemetry.io/docs/specs/otel/common/#attribute-collections
334
364
  *
335
- * @since 1.3.0
365
+ * @since 1.1.0
336
366
  */
337
367
  declare interface Attributes {
338
- [attributeKey: string]: AttributeValue | undefined;
368
+ [attributeKey: string]: AnyValue;
339
369
  }
340
370
 
341
371
  /**
342
- * Attribute values may be any non-nullish primitive value except an object.
343
- *
344
- * null or undefined attribute values are invalid and will result in undefined behavior.
345
- *
346
- * @since 1.3.0
372
+ * @since 1.1.0
373
+ * @deprecated use AnyValue
347
374
  */
348
- declare type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
375
+ declare type AttributeValue = AnyValue;
349
376
 
350
377
  export declare function callCompletionApi({ api, prompt, credentials, headers, body, streamProtocol, setCompletion, setLoading, setError, setAbortController, onFinish, onError, fetch, }: {
351
378
  api: string;
@@ -1537,6 +1564,17 @@ export declare class EmptyResponseBodyError extends AISDKError {
1537
1564
  static isInstance(error: unknown): error is EmptyResponseBodyError;
1538
1565
  }
1539
1566
 
1567
+ /**
1568
+ * Encodes a raw identifier as one URL path segment, including standalone dot
1569
+ * segments that URL parsers would otherwise normalize. Pass unencoded values;
1570
+ * for resource paths with intentional slashes, encode each segment separately.
1571
+ */
1572
+ declare function encodePathSegment(value: string): string;
1573
+
1574
+ declare type EnforcedToolChoice = Extract<LanguageModelV2ToolChoice, {
1575
+ type: 'none';
1576
+ }>;
1577
+
1540
1578
  export declare type ErrorHandler = (error: unknown) => void;
1541
1579
 
1542
1580
  /**
@@ -1578,7 +1616,7 @@ declare interface EventSourceMessage {
1578
1616
  * const eventStream =
1579
1617
  * response.body
1580
1618
  * .pipeThrough(new TextDecoderStream())
1581
- * .pipeThrough(new EventSourceParserStream({terminateOnError: true}))
1619
+ * .pipeThrough(new EventSourceParserStream({onError: 'terminate'}))
1582
1620
  * ```
1583
1621
  *
1584
1622
  * @public
@@ -1587,7 +1625,7 @@ declare class EventSourceParserStream extends TransformStream<
1587
1625
  string,
1588
1626
  EventSourceMessage
1589
1627
  > {
1590
- constructor({ onError, onRetry, onComment }?: StreamOptions);
1628
+ constructor({ onError, onRetry, onComment, maxBufferSize }?: StreamOptions);
1591
1629
  }
1592
1630
 
1593
1631
  /**
@@ -2332,7 +2370,7 @@ declare interface GatewayGenerationInfoParams {
2332
2370
  id: string;
2333
2371
  }
2334
2372
 
2335
- declare type GatewayImageModelId = 'bfl/flux-2-flex' | 'bfl/flux-2-klein-4b' | 'bfl/flux-2-klein-9b' | 'bfl/flux-2-max' | 'bfl/flux-2-pro' | 'bfl/flux-3-image' | 'bfl/flux-kontext-max' | 'bfl/flux-kontext-pro' | 'bfl/flux-pro-1.0-fill' | 'bfl/flux-pro-1.1' | 'bfl/flux-pro-1.1-ultra' | 'bytedance/seedream-4.0' | 'bytedance/seedream-4.5' | 'bytedance/seedream-5.0-lite' | 'bytedance/seedream-5.0-pro' | 'meta/muse-image-1.0' | 'microsoft/mai-image-2.6' | 'microsoft/mai-image-2.6-flash' | 'openai/gpt-image-1' | 'openai/gpt-image-1-mini' | 'openai/gpt-image-1.5' | 'openai/gpt-image-2' | 'openai/gpt-image-2.5-flare' | 'openai/gpt-image-2.5-sunburst' | 'prodia/flux-fast-schnell' | 'quiverai/arrow-1.1' | 'recraft/recraft-v2' | 'recraft/recraft-v3' | 'recraft/recraft-v4' | 'recraft/recraft-v4-pro' | 'recraft/recraft-v4.1' | 'recraft/recraft-v4.1-flash' | 'recraft/recraft-v4.1-pro' | 'recraft/recraft-v4.1-utility' | 'recraft/recraft-v4.1-utility-pro' | 'spacexai/grok-imagine-image' | 'spacexai/grok-imagine-image-2.0' | 'topaz/wonder-3.5' | (string & {});
2373
+ declare type GatewayImageModelId = 'bfl/flux-2-flex' | 'bfl/flux-2-klein-4b' | 'bfl/flux-2-klein-9b' | 'bfl/flux-2-max' | 'bfl/flux-2-pro' | 'bfl/flux-3-image' | 'bfl/flux-3-image-klein' | 'bfl/flux-kontext-max' | 'bfl/flux-kontext-pro' | 'bfl/flux-pro-1.0-fill' | 'bfl/flux-pro-1.1' | 'bfl/flux-pro-1.1-ultra' | 'bytedance/seedream-4.0' | 'bytedance/seedream-4.5' | 'bytedance/seedream-5.0-lite' | 'bytedance/seedream-5.0-pro' | 'meta/muse-image-1.0' | 'microsoft/mai-image-2.6' | 'microsoft/mai-image-2.6-flash' | 'openai/gpt-image-1' | 'openai/gpt-image-1-mini' | 'openai/gpt-image-1.5' | 'openai/gpt-image-2' | 'openai/gpt-image-2.5-flare' | 'openai/gpt-image-2.5-sunburst' | 'prodia/flux-fast-schnell' | 'recraft/recraft-v2' | 'recraft/recraft-v3' | 'recraft/recraft-v4' | 'recraft/recraft-v4-pro' | 'recraft/recraft-v4.1' | 'recraft/recraft-v4.1-flash' | 'recraft/recraft-v4.1-pro' | 'recraft/recraft-v4.1-utility' | 'recraft/recraft-v4.1-utility-pro' | 'spacexai/grok-imagine-image' | 'spacexai/grok-imagine-image-2.0' | 'topaz/wonder-3.5' | (string & {});
2336
2374
 
2337
2375
  declare interface GatewayLanguageModelEntry {
2338
2376
  /**
@@ -2383,7 +2421,7 @@ declare interface GatewayLanguageModelEntry {
2383
2421
 
2384
2422
  declare type GatewayLanguageModelSpecification = Pick<LanguageModelV2, 'specificationVersion' | 'provider' | 'modelId'>;
2385
2423
 
2386
- export declare type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-flash' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'alibaba/qwen3.8-2.4t-a95b' | 'alibaba/qwen3.8-27b' | 'alibaba/qwen3.8-flash' | 'alibaba/qwen3.8-max' | 'alibaba/qwen3.8-max-0902' | 'alibaba/qwen3.8-max-prime' | 'alibaba/qwen3.8-omni-flash' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-fable-5' | 'anthropic/claude-fable-5-batch' | 'anthropic/claude-fable-5.1' | 'anthropic/claude-fable-5.1-batch' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-haiku-4.5-batch' | 'anthropic/claude-haiku-5.5' | 'anthropic/claude-haiku-5.5-batch' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.5-batch' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.6-batch' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.7-batch' | 'anthropic/claude-opus-4.8' | 'anthropic/claude-opus-4.8-batch' | 'anthropic/claude-opus-4.8-fast' | 'anthropic/claude-opus-5' | 'anthropic/claude-opus-5-batch' | 'anthropic/claude-opus-5-fast' | 'anthropic/claude-opus-5.5' | 'anthropic/claude-opus-5.5-batch' | 'anthropic/claude-opus-5.5-fast' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.5-batch' | 'anthropic/claude-sonnet-4.6' | 'anthropic/claude-sonnet-4.6-batch' | 'anthropic/claude-sonnet-5' | 'anthropic/claude-sonnet-5-batch' | 'anthropic/claude-sonnet-5.5' | 'anthropic/claude-sonnet-5.5-batch' | 'arcee-ai/trinity-large-thinking' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'bytedance/seed-2.1-turbo' | 'callstack/apex' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-flash-0731' | 'deepseek/deepseek-v4-flash-vision-exp' | 'deepseek/deepseek-v4-pro' | 'deepseek/deepseek-v4-pro-0813' | 'deepseek/deepseek-v4.1-flash' | 'deepseek/deepseek-v4.1-flash-fast' | 'fireworks/ember-1' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-batch' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-flash-lite-batch' | 'google/gemini-2.5-pro' | 'google/gemini-2.5-pro-batch' | 'google/gemini-3-flash' | 'google/gemini-3-flash-batch' | 'google/gemini-3-pro-image' | 'google/gemini-3.1-flash-image' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-batch' | 'google/gemini-3.1-flash-lite-image' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.1-pro-preview-batch' | 'google/gemini-3.5-flash' | 'google/gemini-3.5-flash-batch' | 'google/gemini-3.5-flash-lite' | 'google/gemini-3.5-flash-lite-batch' | 'google/gemini-3.6-flash' | 'google/gemini-3.6-flash-batch' | 'google/gemini-3.7-flash' | 'google/gemini-3.7-flash-batch' | 'google/gemini-3.8-flash' | 'google/gemini-4-argon' | 'google/gemini-nano-banana-2.1' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-2.5' | 'inception/mercury-coder-small' | 'inclusionai/ling-3.0-flash' | 'inclusionai/ling-3.0-flash-fin' | 'inclusionai/ling-3.0-flash-sante' | 'inclusionai/ling-3.0-flash-vl' | 'inclusionai/ling-3.1-flash' | 'inference-net/schematron-v2-small' | 'inference-net/schematron-v2-turbo' | 'interfaze/interfaze-beta' | 'liquid/lfm2.5-24b-a2b' | 'meituan/longcat-2.5-preview' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'meta/muse-glimmer-30b' | 'meta/muse-spark-1.1' | 'meta/muse-spark-1.2' | 'meta/muse-spark-1.2-contributor' | 'meta/muse-spark-1.3' | 'meta/muse-spark-1.3-contributor' | 'meta/muse-wonder-1.0' | 'minimax/minimax-m2' | 'minimax/minimax-m2.1' | 'minimax/minimax-m2.1-lightning' | 'minimax/minimax-m2.5' | 'minimax/minimax-m2.5-highspeed' | 'minimax/minimax-m2.7' | 'minimax/minimax-m2.7-highspeed' | 'minimax/minimax-m3' | 'mistral/codestral' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-large-4' | 'mistral/mistral-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mixedbread/toast-1' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'moonshotai/kimi-k2.7-code' | 'moonshotai/kimi-k2.7-code-highspeed' | 'moonshotai/kimi-k3' | 'moonshotai/kimi-k3-fast' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | 'nvidia/nemotron-3.5-lightning' | 'nvidia/nemotron-3.5-lightning-free' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | 'openai/gpt-3.5-turbo' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-batch' | 'openai/gpt-4.1-fast' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-mini-batch' | 'openai/gpt-4.1-mini-fast' | 'openai/gpt-4.1-nano' | 'openai/gpt-4.1-nano-batch' | 'openai/gpt-4.1-nano-fast' | 'openai/gpt-4o' | 'openai/gpt-4o-batch' | 'openai/gpt-4o-fast' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-batch' | 'openai/gpt-4o-mini-fast' | 'openai/gpt-5' | 'openai/gpt-5-batch' | 'openai/gpt-5-codex' | 'openai/gpt-5-fast' | 'openai/gpt-5-mini' | 'openai/gpt-5-mini-batch' | 'openai/gpt-5-mini-fast' | 'openai/gpt-5-nano' | 'openai/gpt-5-nano-batch' | 'openai/gpt-5-pro' | 'openai/gpt-5-pro-batch' | 'openai/gpt-5.1-codex' | 'openai/gpt-5.1-codex-max' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1-thinking' | 'openai/gpt-5.1-thinking-fast' | 'openai/gpt-5.2' | 'openai/gpt-5.2-batch' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-fast' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.3-codex-fast' | 'openai/gpt-5.4' | 'openai/gpt-5.4-batch' | 'openai/gpt-5.4-fast' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-mini-batch' | 'openai/gpt-5.4-mini-fast' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-nano-batch' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-batch' | 'openai/gpt-5.5-fast' | 'openai/gpt-5.5-pro' | 'openai/gpt-5.5-pro-batch' | 'openai/gpt-5.6-luna' | 'openai/gpt-5.6-luna-batch' | 'openai/gpt-5.6-luna-fast' | 'openai/gpt-5.6-sol' | 'openai/gpt-5.6-sol-batch' | 'openai/gpt-5.6-sol-fast' | 'openai/gpt-5.6-terra' | 'openai/gpt-5.6-terra-batch' | 'openai/gpt-5.6-terra-fast' | 'openai/gpt-6-astra' | 'openai/gpt-6-astra-batch' | 'openai/gpt-6-astra-fast' | 'openai/gpt-6-luna' | 'openai/gpt-6-luna-batch' | 'openai/gpt-6-luna-fast' | 'openai/gpt-6-sol' | 'openai/gpt-6-sol-batch' | 'openai/gpt-6-sol-fast' | 'openai/gpt-6.1-sol' | 'openai/gpt-6.1-sol-batch' | 'openai/gpt-6.1-sol-fast' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-120b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-fast' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'openai/o4-mini-fast' | 'perplexity/sonar' | 'poolside/laguna-s-2.1' | 'poolside/laguna-s-2.1-free' | 'quiverai/arrow-2' | 'quiverai/arrow-2-telos' | 'sakana/fugu-max' | 'sakana/fugu-ultra' | 'sakana/fugu-ultra-v2' | 'sakana/namazu' | 'spacexai/grok-4.1-fast-non-reasoning' | 'spacexai/grok-4.1-fast-reasoning' | 'spacexai/grok-4.20-multi-agent' | 'spacexai/grok-4.20-multi-agent-batch' | 'spacexai/grok-4.20-multi-agent-beta' | 'spacexai/grok-4.20-non-reasoning' | 'spacexai/grok-4.20-non-reasoning-batch' | 'spacexai/grok-4.20-non-reasoning-beta' | 'spacexai/grok-4.20-reasoning' | 'spacexai/grok-4.20-reasoning-batch' | 'spacexai/grok-4.20-reasoning-beta' | 'spacexai/grok-4.3' | 'spacexai/grok-4.3-batch' | 'spacexai/grok-4.5' | 'spacexai/grok-4.6' | 'spacexai/grok-4.7' | 'spacexai/grok-build-0.1' | 'stealth/glyph-cluster' | 'stepfun/step-3.7-flash' | 'stepfun/step-5-preview' | 'tencent/hy-mt2-lite' | 'tencent/hy-mt2-plus' | 'tencent/hy-mt2-pro' | 'tencent/hy3' | 'tencent/hy4-preview' | 'thinkingmachines/inkling' | 'thinkingmachines/inkling-small' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-pro' | 'xiaomi/mimo-v2.6-flash' | 'xiaomi/mimo-v2.6-pro' | 'xiaomi/mimo-v2.6-pro-ultraspeed' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.7' | 'zai/glm-4.7-flash' | 'zai/glm-4.7-flashx' | 'zai/glm-5' | 'zai/glm-5-turbo' | 'zai/glm-5.1' | 'zai/glm-5.2' | 'zai/glm-5.2-fast' | 'zai/glm-5.3' | 'zai/glm-5.3-fast' | 'zai/glm-5.3-flash' | 'zai/glm-5.3-flashx' | 'zai/glm-5v-turbo' | (string & {});
2424
+ export declare type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-flash' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'alibaba/qwen3.8-2.4t-a95b' | 'alibaba/qwen3.8-27b' | 'alibaba/qwen3.8-flash' | 'alibaba/qwen3.8-max' | 'alibaba/qwen3.8-max-0902' | 'alibaba/qwen3.8-max-prime' | 'alibaba/qwen3.8-omni-flash' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-fable-5' | 'anthropic/claude-fable-5-batch' | 'anthropic/claude-fable-5.1' | 'anthropic/claude-fable-5.1-batch' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-haiku-4.5-batch' | 'anthropic/claude-haiku-5.5' | 'anthropic/claude-haiku-5.5-batch' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.5-batch' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.6-batch' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.7-batch' | 'anthropic/claude-opus-4.8' | 'anthropic/claude-opus-4.8-batch' | 'anthropic/claude-opus-4.8-fast' | 'anthropic/claude-opus-5' | 'anthropic/claude-opus-5-batch' | 'anthropic/claude-opus-5-fast' | 'anthropic/claude-opus-5.5' | 'anthropic/claude-opus-5.5-batch' | 'anthropic/claude-opus-5.5-fast' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.5-batch' | 'anthropic/claude-sonnet-4.6' | 'anthropic/claude-sonnet-4.6-batch' | 'anthropic/claude-sonnet-5' | 'anthropic/claude-sonnet-5-batch' | 'anthropic/claude-sonnet-5.5' | 'anthropic/claude-sonnet-5.5-batch' | 'arcee-ai/trinity-large-thinking' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'bytedance/seed-2.1-turbo' | 'callstack/apex' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-flash-0731' | 'deepseek/deepseek-v4-flash-vision-exp' | 'deepseek/deepseek-v4-pro' | 'deepseek/deepseek-v4-pro-0813' | 'deepseek/deepseek-v4.1-flash' | 'deepseek/deepseek-v4.1-flash-1017' | 'deepseek/deepseek-v4.1-flash-1017-fast' | 'deepseek/deepseek-v4.1-flash-fast' | 'elorian/glimpse' | 'fireworks/ember-1' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-batch' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-flash-lite-batch' | 'google/gemini-2.5-pro' | 'google/gemini-2.5-pro-batch' | 'google/gemini-3-flash' | 'google/gemini-3-flash-batch' | 'google/gemini-3-pro-image' | 'google/gemini-3.1-flash-image' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-batch' | 'google/gemini-3.1-flash-lite-image' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.1-pro-preview-batch' | 'google/gemini-3.5-flash' | 'google/gemini-3.5-flash-batch' | 'google/gemini-3.5-flash-lite' | 'google/gemini-3.5-flash-lite-batch' | 'google/gemini-3.6-flash' | 'google/gemini-3.6-flash-batch' | 'google/gemini-3.7-flash' | 'google/gemini-3.7-flash-batch' | 'google/gemini-3.8-flash' | 'google/gemini-4-argon' | 'google/gemini-nano-banana-2.1' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-2.5' | 'inception/mercury-3' | 'inception/mercury-coder-small' | 'inclusionai/ling-3.0-flash' | 'inclusionai/ling-3.0-flash-fin' | 'inclusionai/ling-3.0-flash-sante' | 'inclusionai/ling-3.0-flash-vl' | 'inclusionai/ling-3.1-flash' | 'inference-net/schematron-v2-small' | 'inference-net/schematron-v2-turbo' | 'interfaze/interfaze-beta' | 'liquid/lfm2.5-24b-a2b' | 'meituan/longcat-2.5-preview' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'meta/muse-glimmer-30b' | 'meta/muse-spark-1.1' | 'meta/muse-spark-1.2' | 'meta/muse-spark-1.2-contributor' | 'meta/muse-spark-1.3' | 'meta/muse-spark-1.3-contributor' | 'meta/muse-spark-open' | 'meta/muse-wonder-1.0' | 'minimax/minimax-m2' | 'minimax/minimax-m2.1' | 'minimax/minimax-m2.1-lightning' | 'minimax/minimax-m2.5' | 'minimax/minimax-m2.5-highspeed' | 'minimax/minimax-m2.7' | 'minimax/minimax-m2.7-highspeed' | 'minimax/minimax-m3' | 'minimax/minimax-m3.1-flash' | 'mistral/codestral' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-large-4' | 'mistral/mistral-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mixedbread/toast-1' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'moonshotai/kimi-k2.7-code' | 'moonshotai/kimi-k2.7-code-highspeed' | 'moonshotai/kimi-k3' | 'moonshotai/kimi-k3-fast' | 'moonshotai/kimi-k3.1-pro' | 'moonshotai/kimi-k3.1-pro-highspeed' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | 'nvidia/nemotron-3.5-lightning' | 'nvidia/nemotron-3.5-lightning-free' | 'nvidia/nemotron-3.5-super-vl' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | 'openai/gpt-4.1' | 'openai/gpt-4.1-batch' | 'openai/gpt-4.1-fast' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-mini-batch' | 'openai/gpt-4.1-mini-fast' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-batch' | 'openai/gpt-4o-fast' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-batch' | 'openai/gpt-4o-mini-fast' | 'openai/gpt-5' | 'openai/gpt-5-batch' | 'openai/gpt-5-codex' | 'openai/gpt-5-fast' | 'openai/gpt-5-mini' | 'openai/gpt-5-mini-batch' | 'openai/gpt-5-mini-fast' | 'openai/gpt-5-nano' | 'openai/gpt-5-nano-batch' | 'openai/gpt-5-pro' | 'openai/gpt-5-pro-batch' | 'openai/gpt-5.1-codex' | 'openai/gpt-5.1-codex-max' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1-thinking' | 'openai/gpt-5.1-thinking-fast' | 'openai/gpt-5.2' | 'openai/gpt-5.2-batch' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-fast' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.3-codex-fast' | 'openai/gpt-5.4' | 'openai/gpt-5.4-batch' | 'openai/gpt-5.4-fast' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-mini-batch' | 'openai/gpt-5.4-mini-fast' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-nano-batch' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-batch' | 'openai/gpt-5.5-fast' | 'openai/gpt-5.5-pro' | 'openai/gpt-5.5-pro-batch' | 'openai/gpt-5.6-luna' | 'openai/gpt-5.6-luna-batch' | 'openai/gpt-5.6-luna-fast' | 'openai/gpt-5.6-sol' | 'openai/gpt-5.6-sol-batch' | 'openai/gpt-5.6-sol-fast' | 'openai/gpt-5.6-terra' | 'openai/gpt-5.6-terra-batch' | 'openai/gpt-5.6-terra-fast' | 'openai/gpt-6-astra' | 'openai/gpt-6-astra-batch' | 'openai/gpt-6-astra-fast' | 'openai/gpt-6-luna' | 'openai/gpt-6-luna-batch' | 'openai/gpt-6-luna-fast' | 'openai/gpt-6-sol' | 'openai/gpt-6-sol-batch' | 'openai/gpt-6-sol-fast' | 'openai/gpt-6.1-sol' | 'openai/gpt-6.1-sol-batch' | 'openai/gpt-6.1-sol-fast' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-120b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-fast' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'perplexity/sonar' | 'poolside/laguna-s-2.1' | 'poolside/laguna-s-2.1-free' | 'quiverai/arrow-2' | 'quiverai/arrow-2-telos' | 'reflection/beam' | 'reflection/beam-free' | 'sakana/fugu-max' | 'sakana/fugu-ultra' | 'sakana/fugu-ultra-v2' | 'sakana/namazu' | 'scaledown/scaledown-extract-1' | 'scaledown/scaledown-summarize-1' | 'spacexai/grok-4.20-multi-agent' | 'spacexai/grok-4.20-multi-agent-batch' | 'spacexai/grok-4.20-multi-agent-beta' | 'spacexai/grok-4.20-non-reasoning' | 'spacexai/grok-4.20-non-reasoning-batch' | 'spacexai/grok-4.20-non-reasoning-beta' | 'spacexai/grok-4.20-reasoning' | 'spacexai/grok-4.20-reasoning-batch' | 'spacexai/grok-4.20-reasoning-beta' | 'spacexai/grok-4.3' | 'spacexai/grok-4.3-batch' | 'spacexai/grok-4.5' | 'spacexai/grok-4.6' | 'spacexai/grok-4.7' | 'spacexai/grok-build-0.1' | 'stealth/glyph-cluster' | 'stepfun/step-3.7-flash' | 'stepfun/step-5-preview' | 'tencent/hy-mt2-lite' | 'tencent/hy-mt2-plus' | 'tencent/hy-mt2-pro' | 'tencent/hy3' | 'tencent/hy4-preview' | 'thinkingmachines/inkling' | 'thinkingmachines/inkling-small' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-pro' | 'xiaomi/mimo-v2.6-flash' | 'xiaomi/mimo-v2.6-pro' | 'xiaomi/mimo-v2.6-pro-ultraspeed' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.7' | 'zai/glm-4.7-flash' | 'zai/glm-4.7-flashx' | 'zai/glm-5' | 'zai/glm-5-turbo' | 'zai/glm-5.1' | 'zai/glm-5.2' | 'zai/glm-5.2-fast' | 'zai/glm-5.3' | 'zai/glm-5.3-fast' | 'zai/glm-5.3-flash' | 'zai/glm-5.3-flashx' | 'zai/glm-5v-turbo' | (string & {});
2387
2425
 
2388
2426
  declare interface GatewayProvider extends ProviderV2 {
2389
2427
  (modelId: GatewayModelId): LanguageModelV2;
@@ -3400,7 +3438,7 @@ declare function injectJsonInstructionIntoMessages({ messages, schema, schemaPre
3400
3438
  }): LanguageModelV2Prompt;
3401
3439
 
3402
3440
  export declare class InvalidArgumentError extends AISDKError {
3403
- private readonly [symbol$c_2];
3441
+ private readonly [symbol$d_2];
3404
3442
  readonly parameter: string;
3405
3443
  readonly value: unknown;
3406
3444
  constructor({ parameter, value, message, }: {
@@ -3462,7 +3500,7 @@ export declare class InvalidResponseDataError extends AISDKError {
3462
3500
  }
3463
3501
 
3464
3502
  export declare class InvalidStreamPartError extends AISDKError {
3465
- private readonly [symbol$b_2];
3503
+ private readonly [symbol$c_2];
3466
3504
  readonly chunk: SingleRequestTextStreamPart<any>;
3467
3505
  constructor({ chunk, message, }: {
3468
3506
  chunk: SingleRequestTextStreamPart<any>;
@@ -3472,7 +3510,7 @@ export declare class InvalidStreamPartError extends AISDKError {
3472
3510
  }
3473
3511
 
3474
3512
  export declare class InvalidToolInputError extends AISDKError {
3475
- private readonly [symbol$e];
3513
+ private readonly [symbol$f];
3476
3514
  readonly toolName: string;
3477
3515
  readonly toolInput: string;
3478
3516
  constructor({ toolInput, toolName, cause, message, }: {
@@ -4559,7 +4597,11 @@ declare interface Link {
4559
4597
  context: SpanContext;
4560
4598
  /** A set of {@link SpanAttributes} on the link. */
4561
4599
  attributes?: SpanAttributes;
4562
- /** Count of attributes of the link that were dropped due to collection limits */
4600
+ /**
4601
+ * Count of attributes of the link that were dropped due to collection limits
4602
+ *
4603
+ * @since 1.4.1
4604
+ */
4563
4605
  droppedAttributesCount?: number;
4564
4606
  }
4565
4607
 
@@ -4663,7 +4705,7 @@ export declare class NoContentGeneratedError extends AISDKError {
4663
4705
  - The model generated a response that could not be parsed.
4664
4706
  */
4665
4707
  export declare class NoImageGeneratedError extends AISDKError {
4666
- private readonly [symbol$a];
4708
+ private readonly [symbol$b_2];
4667
4709
  /**
4668
4710
  The response metadata for each call.
4669
4711
  */
@@ -4688,7 +4730,7 @@ export declare class NoImageGeneratedError extends AISDKError {
4688
4730
  - `text`: The text that was generated by the model. This can be the raw text or the tool call text, depending on the model.
4689
4731
  */
4690
4732
  export declare class NoObjectGeneratedError extends AISDKError {
4691
- private readonly [symbol$9_2];
4733
+ private readonly [symbol$a];
4692
4734
  /**
4693
4735
  The text that was generated by the model. This can be the raw text or the tool call text, depending on the model.
4694
4736
  */
@@ -4720,7 +4762,7 @@ export declare class NoObjectGeneratedError extends AISDKError {
4720
4762
  Thrown when no LLM output was generated, e.g. because of errors.
4721
4763
  */
4722
4764
  export declare class NoOutputGeneratedError extends AISDKError {
4723
- private readonly [symbol$8_2];
4765
+ private readonly [symbol$9_2];
4724
4766
  constructor({ message, cause, }?: {
4725
4767
  message?: string;
4726
4768
  cause?: Error;
@@ -4732,7 +4774,7 @@ export declare class NoOutputGeneratedError extends AISDKError {
4732
4774
  Thrown when no output type is specified and output-related methods are called.
4733
4775
  */
4734
4776
  export declare class NoOutputSpecifiedError extends AISDKError {
4735
- private readonly [symbol$7_2];
4777
+ private readonly [symbol$8_2];
4736
4778
  constructor({ message }?: {
4737
4779
  message?: string;
4738
4780
  });
@@ -4786,7 +4828,7 @@ export declare class NoSuchProviderError extends NoSuchModelError {
4786
4828
  }
4787
4829
 
4788
4830
  export declare class NoSuchToolError extends AISDKError {
4789
- private readonly [symbol$d_2];
4831
+ private readonly [symbol$e];
4790
4832
  readonly toolName: string;
4791
4833
  readonly availableTools: string[] | undefined;
4792
4834
  constructor({ toolName, availableTools, message, }: {
@@ -4841,11 +4883,9 @@ export declare interface OutputInterface<OUTPUT, PARTIAL> {
4841
4883
 
4842
4884
  declare interface ParallelSearchConfig {
4843
4885
  /**
4844
- * Mode preset for different use cases:
4845
- * - "one-shot": Comprehensive results with longer excerpts for single-response answers (default)
4846
- * - "agentic": Concise, token-efficient results for multi-step agentic workflows
4886
+ * Search mode. Defaults to `basic`.
4847
4887
  */
4848
- mode?: 'one-shot' | 'agentic';
4888
+ mode?: ParallelSearchMode;
4849
4889
  /**
4850
4890
  * Default maximum number of results to return (1-20).
4851
4891
  * Defaults to 10 if not specified.
@@ -4859,15 +4899,24 @@ declare interface ParallelSearchConfig {
4859
4899
  * Default excerpt configuration for controlling result length.
4860
4900
  */
4861
4901
  excerpts?: ParallelSearchExcerpts;
4902
+ /**
4903
+ * Maximum total characters across all result excerpts.
4904
+ */
4905
+ maxCharsTotal?: number;
4862
4906
  /**
4863
4907
  * Default fetch policy for controlling content freshness.
4864
4908
  */
4865
4909
  fetchPolicy?: ParallelSearchFetchPolicy;
4910
+ /**
4911
+ * ISO 3166-1 alpha-2 country code to localize results, e.g. 'us'.
4912
+ * Invalid codes are ignored with a warning.
4913
+ */
4914
+ location?: string;
4866
4915
  }
4867
4916
 
4868
4917
  declare interface ParallelSearchError {
4869
4918
  /** Error type */
4870
- error: 'api_error' | 'rate_limit' | 'timeout' | 'invalid_input' | 'configuration_error' | 'unknown';
4919
+ error: 'api_error' | 'configuration_error' | 'execution_error' | 'gateway_rate_limit' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown' | 'unknown_tool';
4871
4920
  /** HTTP status code if applicable */
4872
4921
  statusCode?: number;
4873
4922
  /** Human-readable error message */
@@ -4881,16 +4930,27 @@ declare interface ParallelSearchExcerpts {
4881
4930
  maxCharsPerResult?: number;
4882
4931
  /**
4883
4932
  * Maximum total characters across all results.
4933
+ * @deprecated Use the top-level `maxCharsTotal` option instead.
4884
4934
  */
4885
4935
  maxCharsTotal?: number;
4886
4936
  }
4887
4937
 
4888
4938
  declare interface ParallelSearchFetchPolicy {
4889
4939
  /**
4890
- * Maximum age in seconds for cached content.
4891
- * Set to 0 to always fetch fresh content.
4940
+ * Maximum age in seconds of cached content before a live fetch is attempted.
4941
+ * Minimum 600; lower values are raised to 600.
4892
4942
  */
4893
4943
  maxAgeSeconds?: number;
4944
+ /**
4945
+ * Timeout in seconds for a live fetch when content is not cached.
4946
+ * The gateway caps it to stay within its own tool timeout.
4947
+ */
4948
+ timeoutSeconds?: number;
4949
+ /**
4950
+ * Return an error instead of falling back to older cached content when a
4951
+ * live fetch fails or times out. Defaults to false.
4952
+ */
4953
+ disableCacheFallback?: boolean;
4894
4954
  }
4895
4955
 
4896
4956
  declare interface ParallelSearchInput {
@@ -4901,16 +4961,13 @@ declare interface ParallelSearchInput {
4901
4961
  */
4902
4962
  objective: string;
4903
4963
  /**
4904
- * Optional search queries to supplement the objective.
4905
- * Maximum 200 characters per query.
4964
+ * 2-3 concise keyword queries, 3-6 words each (max 5, 200 characters each).
4906
4965
  */
4907
4966
  search_queries?: string[];
4908
4967
  /**
4909
- * Mode preset for different use cases:
4910
- * - "one-shot": Comprehensive results with longer excerpts
4911
- * - "agentic": Concise, token-efficient results for multi-step workflows
4968
+ * Search mode. Defaults to `basic`.
4912
4969
  */
4913
- mode?: 'one-shot' | 'agentic';
4970
+ mode?: ParallelSearchMode;
4914
4971
  /**
4915
4972
  * Maximum number of results to return (1-20).
4916
4973
  * Defaults to 10 if not specified.
@@ -4929,51 +4986,75 @@ declare interface ParallelSearchInput {
4929
4986
  */
4930
4987
  excerpts?: {
4931
4988
  max_chars_per_result?: number;
4989
+ /** @deprecated Use the top-level `max_chars_total` instead. */
4932
4990
  max_chars_total?: number;
4933
4991
  };
4992
+ /**
4993
+ * Maximum total characters across all result excerpts.
4994
+ */
4995
+ max_chars_total?: number;
4934
4996
  /**
4935
4997
  * Fetch policy for controlling content freshness.
4936
4998
  */
4937
4999
  fetch_policy?: {
4938
5000
  max_age_seconds?: number;
5001
+ timeout_seconds?: number;
5002
+ disable_cache_fallback?: boolean;
4939
5003
  };
5004
+ /**
5005
+ * ISO 3166-1 alpha-2 country code to localize results.
5006
+ */
5007
+ location?: string;
4940
5008
  }
4941
5009
 
5010
+ /**
5011
+ * Search mode. `turbo` and `fast` trade excerpt depth for latency (`turbo` is
5012
+ * English and Japanese only), `basic` is balanced, `advanced` is the most thorough.
5013
+ * Deprecated: `one-shot` (runs as `basic`) and `agentic` (runs as `advanced`).
5014
+ */
5015
+ declare type ParallelSearchMode = (typeof parallelSearchModes)[number];
5016
+
5017
+ declare const parallelSearchModes: readonly ["turbo", "fast", "basic", "advanced", "one-shot", "agentic"];
5018
+
4942
5019
  declare type ParallelSearchOutput = ParallelSearchResponse | ParallelSearchError;
4943
5020
 
4944
5021
  declare interface ParallelSearchResponse {
4945
5022
  /** Unique identifier for this search request */
4946
- searchId: string;
4947
- /** Array of search results */
5023
+ search_id: string;
5024
+ /** Search results, ordered by decreasing relevance */
4948
5025
  results: ParallelSearchResult[];
5026
+ /** Non-fatal issues with the request, such as an ignored `location` */
5027
+ warnings?: ParallelSearchWarning[] | null;
5028
+ /** Usage reported by Parallel for this search */
5029
+ usage?: ParallelSearchUsage[] | null;
5030
+ /** Session identifier shared by the searches made during one request */
5031
+ session_id?: string;
4949
5032
  }
4950
5033
 
4951
5034
  declare interface ParallelSearchResult {
4952
5035
  /** URL of the search result */
4953
5036
  url: string;
4954
- /** Title of the search result */
4955
- title: string;
4956
- /** Extracted text excerpt/content from the page */
4957
- excerpt: string;
4958
- /** Publication date of the content (may be null) */
4959
- publishDate?: string | null;
4960
- /** Relevance score for the result */
4961
- relevanceScore?: number;
5037
+ /** Title of the page, if available */
5038
+ title?: string | null;
5039
+ /** Publication date of the page (YYYY-MM-DD), if available */
5040
+ publish_date?: string | null;
5041
+ /** Relevant excerpts from the page, formatted as markdown */
5042
+ excerpts: string[];
4962
5043
  }
4963
5044
 
4964
5045
  declare interface ParallelSearchSourcePolicy {
4965
5046
  /**
4966
- * List of domains to include in search results.
4967
- * Example: ['wikipedia.org', 'nature.com']
5047
+ * Domains or domain/path prefixes to restrict results to. When set,
5048
+ * `excludeDomains` is ignored. Example: ['wikipedia.org', 'docs.python.org/3']
4968
5049
  */
4969
5050
  includeDomains?: string[];
4970
5051
  /**
4971
- * List of domains to exclude from search results.
4972
- * Example: ['reddit.com', 'twitter.com']
5052
+ * Domains or domain/path prefixes to exclude from results.
5053
+ * Example: ['reddit.com']
4973
5054
  */
4974
5055
  excludeDomains?: string[];
4975
5056
  /**
4976
- * Only include results published after this date (ISO 8601 format).
5057
+ * Only include results published on or after this date (YYYY-MM-DD).
4977
5058
  * Example: '2024-01-01'
4978
5059
  */
4979
5060
  afterDate?: string;
@@ -4981,6 +5062,22 @@ declare interface ParallelSearchSourcePolicy {
4981
5062
 
4982
5063
  declare const parallelSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<ParallelSearchInput, ParallelSearchOutput, ParallelSearchConfig>;
4983
5064
 
5065
+ declare interface ParallelSearchUsage {
5066
+ /** Usage item name, e.g. 'sku_search' */
5067
+ name: string;
5068
+ /** Count for the usage item */
5069
+ count?: number;
5070
+ }
5071
+
5072
+ declare interface ParallelSearchWarning {
5073
+ /** Warning type, e.g. 'input_validation_warning'. New types may be added. */
5074
+ type: string;
5075
+ /** Human-readable message */
5076
+ message: string;
5077
+ /** Optional detail supporting the warning */
5078
+ detail?: Record<string, unknown> | null;
5079
+ }
5080
+
4984
5081
  /**
4985
5082
  * Parses a JSON string into an unknown object.
4986
5083
  *
@@ -5997,6 +6094,8 @@ declare interface Span {
5997
6094
  * It is preferred span links be added at span creation.
5998
6095
  *
5999
6096
  * @param link the link to add.
6097
+ *
6098
+ * @since 1.9.0
6000
6099
  */
6001
6100
  addLink(link: Link): this;
6002
6101
  /**
@@ -6006,6 +6105,8 @@ declare interface Span {
6006
6105
  * It is preferred span links be added at span creation.
6007
6106
  *
6008
6107
  * @param links the links to add.
6108
+ *
6109
+ * @since 1.9.0
6009
6110
  */
6010
6111
  addLinks(links: Link[]): this;
6011
6112
  /**
@@ -7005,6 +7106,16 @@ declare interface StreamOptions {
7005
7106
  * @param comment - The comment encountered in the stream.
7006
7107
  */
7007
7108
  onComment?: ((comment: string) => void) | undefined;
7109
+ /**
7110
+ * Maximum number of characters the parser is allowed to buffer across calls to `feed()`.
7111
+ * See {@link ParserConfig.maxBufferSize} for details.
7112
+ *
7113
+ * When the limit is exceeded, the stream is always errored (regardless of the `onError`
7114
+ * setting) since the underlying parser is unrecoverable without a `reset()`.
7115
+ *
7116
+ * @defaultValue `undefined` (unbounded)
7117
+ */
7118
+ maxBufferSize?: number | undefined;
7008
7119
  }
7009
7120
 
7010
7121
  /**
@@ -7489,6 +7600,8 @@ declare const symbol$d_2: unique symbol;
7489
7600
 
7490
7601
  declare const symbol$e: unique symbol;
7491
7602
 
7603
+ declare const symbol$f: unique symbol;
7604
+
7492
7605
  declare const symbol: unique symbol;
7493
7606
 
7494
7607
  declare const symbol_2: unique symbol;
@@ -7855,7 +7968,7 @@ export declare interface ToolCallPart {
7855
7968
  }
7856
7969
 
7857
7970
  export declare class ToolCallRepairError extends AISDKError {
7858
- private readonly [symbol$6_2];
7971
+ private readonly [symbol$7_2];
7859
7972
  readonly originalError: NoSuchToolError | InvalidToolInputError;
7860
7973
  constructor({ cause, originalError, message, }: {
7861
7974
  message?: string;
@@ -7902,6 +8015,42 @@ export declare type ToolChoice<TOOLS extends Record<string, unknown>> = 'auto' |
7902
8015
  toolName: Extract<keyof TOOLS, string>;
7903
8016
  };
7904
8017
 
8018
+ /**
8019
+ * Thrown when a model response does not satisfy an enforced tool choice.
8020
+ */
8021
+ export declare class ToolChoiceViolationError extends AISDKError {
8022
+ private readonly [symbol$6_2];
8023
+ /**
8024
+ * The tool choice that the model response did not satisfy.
8025
+ */
8026
+ readonly toolChoice: EnforcedToolChoice;
8027
+ /**
8028
+ * Reason why the model finished generating the response.
8029
+ */
8030
+ readonly finishReason: FinishReason;
8031
+ /**
8032
+ * The provider that returned the response.
8033
+ */
8034
+ readonly provider: string;
8035
+ /**
8036
+ * The model that returned the response.
8037
+ */
8038
+ readonly modelId: string;
8039
+ /**
8040
+ * The normalized content returned by the model.
8041
+ */
8042
+ readonly content: Array<LanguageModelV2Content>;
8043
+ constructor({ toolChoice, finishReason, provider, modelId, content, message, }: {
8044
+ toolChoice: EnforcedToolChoice;
8045
+ finishReason: FinishReason;
8046
+ provider: string;
8047
+ modelId: string;
8048
+ content: Array<LanguageModelV2Content>;
8049
+ message?: string;
8050
+ });
8051
+ static isInstance(error: unknown): error is ToolChoiceViolationError;
8052
+ }
8053
+
7905
8054
  /**
7906
8055
  Content of a tool message. It is an array of tool result parts.
7907
8056
  */
@@ -8046,6 +8195,11 @@ declare interface Tracer {
8046
8195
  * Additionally the new span gets set in context and this context is activated
8047
8196
  * for the duration of the function call.
8048
8197
  *
8198
+ * **Important**: The callback function is responsible for calling `span.end()`
8199
+ * to finish the span. Unlike some other OpenTelemetry implementations, the span
8200
+ * is NOT automatically ended when the callback returns. If `span.end()` is not
8201
+ * called, the span will never be exported and will be silently lost.
8202
+ *
8049
8203
  * @param name The name of the span
8050
8204
  * @param [options] SpanOptions used for span creation
8051
8205
  * @param [context] Context to use to extract parent
@@ -8987,5 +9141,5 @@ export declare function zodSchema<OBJECT>(zodSchema: z4.core.$ZodType<OBJECT, an
8987
9141
  }): Schema<OBJECT>;
8988
9142
 
8989
9143
  export { }
8990
- export { GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider, ParseResult as ParseResult, FlexibleValidator as FlexibleValidator, ValidationResult as ValidationResult, LanguageModelV2ToolResultOutput as LanguageModelV2ToolResultOutput, ProviderOptions as ProviderOptions, ReasoningPart as ReasoningPart, ToolOutputProperties as ToolOutputProperties, LanguageModelV2ToolResultPart as LanguageModelV2ToolResultPart, FlexibleSchema as FlexibleSchema, ImageModelV2CallWarning as ImageModelV2CallWarning, SpeechModelV2CallWarning as SpeechModelV2CallWarning, TranscriptionModelV2CallWarning as TranscriptionModelV2CallWarning, AttributeValue as AttributeValue, Tracer as Tracer, EmbeddingModelV2Embedding as EmbeddingModelV2Embedding, ImageModelV2ProviderMetadata as ImageModelV2ProviderMetadata, GlobalProviderModelId as GlobalProviderModelId, LanguageModelV2FinishReason as LanguageModelV2FinishReason, LanguageModelV2CallWarning as LanguageModelV2CallWarning, LanguageModelV2Middleware as LanguageModelV2Middleware, SharedV2ProviderMetadata as SharedV2ProviderMetadata, LanguageModelV2Usage as LanguageModelV2Usage, Source as Source, ResponseMessage as ResponseMessage, DeepPartialInternal as DeepPartialInternal, LanguageModelV2ToolCall as LanguageModelV2ToolCall, StreamTextOnAbortCallback as StreamTextOnAbortCallback, ValueOf as ValueOf, asUITool as asUITool, _ai_sdk_provider_utils as _ai_sdk_provider_utils, DataUIMessageChunk as DataUIMessageChunk, ConsumeStreamOptions as ConsumeStreamOptions, InferAgentTools as InferAgentTools, SingleRequestTextStreamPart as SingleRequestTextStreamPart, RetryErrorReason as RetryErrorReason, InferSchema as InferSchema, Job as Job, StreamObjectOnErrorCallback as StreamObjectOnErrorCallback, JSONValue_2 as JSONValue_2, LanguageModelV2CallOptions as LanguageModelV2CallOptions, LanguageModelV2 as LanguageModelV2, EmbeddingModelV2 as EmbeddingModelV2, ImageModelV2 as ImageModelV2, TranscriptionModelV2 as TranscriptionModelV2, SpeechModelV2 as SpeechModelV2, ExtractModelId as ExtractModelId, ExtractLiteralUnion as ExtractLiteralUnion, ProviderV2 as ProviderV2, getOriginalFetch as getOriginalFetch, UIMessageStreamResponseInit as UIMessageStreamResponseInit, InferUIMessageToolCall as InferUIMessageToolCall, Validator as Validator, StandardSchemaV1 as StandardSchemaV1, UIDataTypesToSchemas as UIDataTypesToSchemas, InferUIMessageData as InferUIMessageData, InferUIMessageMetadata as InferUIMessageMetadata, InferUIMessageTools as InferUIMessageTools, Resolvable as Resolvable, FetchFunction as FetchFunction, ValidateUIMessagesOptions as ValidateUIMessagesOptions };
8991
- export { EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL, schemaSymbol, symbol$1, symbol$1_2, symbol$2, symbol$2_2, symbol$3, symbol$3_2, symbol$4, symbol$4_2, symbol$5, symbol$5_2, symbol$6, symbol$6_2, symbol$7, symbol$7_2, symbol$8, symbol$8_2, symbol$9, symbol$9_2, symbol$a, symbol$b, symbol$b_2, symbol$c, symbol$c_2, symbol$d, symbol$d_2, symbol$e, symbol, symbol_2, symbol_3, validatorSymbol };
9144
+ export { GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider, ParseResult as ParseResult, FlexibleValidator as FlexibleValidator, ValidationResult as ValidationResult, LanguageModelV2ToolResultOutput as LanguageModelV2ToolResultOutput, ProviderOptions as ProviderOptions, ReasoningPart as ReasoningPart, ToolOutputProperties as ToolOutputProperties, LanguageModelV2ToolResultPart as LanguageModelV2ToolResultPart, FlexibleSchema as FlexibleSchema, ImageModelV2CallWarning as ImageModelV2CallWarning, SpeechModelV2CallWarning as SpeechModelV2CallWarning, TranscriptionModelV2CallWarning as TranscriptionModelV2CallWarning, AttributeValue as AttributeValue, Tracer as Tracer, EmbeddingModelV2Embedding as EmbeddingModelV2Embedding, ImageModelV2ProviderMetadata as ImageModelV2ProviderMetadata, GlobalProviderModelId as GlobalProviderModelId, LanguageModelV2FinishReason as LanguageModelV2FinishReason, LanguageModelV2CallWarning as LanguageModelV2CallWarning, LanguageModelV2Middleware as LanguageModelV2Middleware, SharedV2ProviderMetadata as SharedV2ProviderMetadata, LanguageModelV2Usage as LanguageModelV2Usage, Source as Source, ResponseMessage as ResponseMessage, DeepPartialInternal as DeepPartialInternal, LanguageModelV2ToolCall as LanguageModelV2ToolCall, StreamTextOnAbortCallback as StreamTextOnAbortCallback, ValueOf as ValueOf, asUITool as asUITool, _ai_sdk_provider_utils as _ai_sdk_provider_utils, DataUIMessageChunk as DataUIMessageChunk, ConsumeStreamOptions as ConsumeStreamOptions, InferAgentTools as InferAgentTools, SingleRequestTextStreamPart as SingleRequestTextStreamPart, EnforcedToolChoice as EnforcedToolChoice, LanguageModelV2Content as LanguageModelV2Content, RetryErrorReason as RetryErrorReason, InferSchema as InferSchema, Job as Job, StreamObjectOnErrorCallback as StreamObjectOnErrorCallback, JSONValue_2 as JSONValue_2, LanguageModelV2CallOptions as LanguageModelV2CallOptions, LanguageModelV2 as LanguageModelV2, EmbeddingModelV2 as EmbeddingModelV2, ImageModelV2 as ImageModelV2, TranscriptionModelV2 as TranscriptionModelV2, SpeechModelV2 as SpeechModelV2, ExtractModelId as ExtractModelId, ExtractLiteralUnion as ExtractLiteralUnion, ProviderV2 as ProviderV2, getOriginalFetch as getOriginalFetch, UIMessageStreamResponseInit as UIMessageStreamResponseInit, InferUIMessageToolCall as InferUIMessageToolCall, Validator as Validator, StandardSchemaV1 as StandardSchemaV1, UIDataTypesToSchemas as UIDataTypesToSchemas, InferUIMessageData as InferUIMessageData, InferUIMessageMetadata as InferUIMessageMetadata, InferUIMessageTools as InferUIMessageTools, Resolvable as Resolvable, FetchFunction as FetchFunction, ValidateUIMessagesOptions as ValidateUIMessagesOptions };
9145
+ export { EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL, schemaSymbol, symbol$1, symbol$1_2, symbol$2, symbol$2_2, symbol$3, symbol$3_2, symbol$4, symbol$4_2, symbol$5, symbol$5_2, symbol$6, symbol$6_2, symbol$7, symbol$7_2, symbol$8, symbol$8_2, symbol$9, symbol$9_2, symbol$a, symbol$b, symbol$b_2, symbol$c, symbol$c_2, symbol$d, symbol$d_2, symbol$e, symbol$f, symbol, symbol_2, symbol_3, validatorSymbol };