@mastra/voice-google 0.14.2 → 0.14.3

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.
Files changed (59) hide show
  1. package/dist/_types/@internal_voice/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +253 -42
  2. package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/request-context/index.d.ts +69 -2
  3. package/dist/_types/@internal_voice/dist/_types/zod/v3/ZodError.d.ts +1 -1
  4. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/checks.d.ts +1 -1
  5. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/compat.d.ts +9 -11
  6. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/deep-partial.d.ts +14 -0
  7. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/errors.d.ts +3 -4
  8. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/external.d.ts +5 -2
  9. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/in-out.d.ts +8 -0
  10. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/index.d.ts +1 -2
  11. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/iso.d.ts +2 -17
  12. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/parse.d.ts +17 -4
  13. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/schemas.d.ts +68 -19
  14. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/api.d.ts +22 -12
  15. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/checks.d.ts +29 -13
  16. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/compile.d.ts +65 -0
  17. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/core.d.ts +16 -4
  18. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/doc.d.ts +3 -1
  19. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/errors.d.ts +4 -0
  20. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/index.d.ts +3 -0
  21. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema-generator.d.ts +2 -2
  22. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema-processors.d.ts +16 -0
  23. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema.d.ts +2 -1
  24. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/memoizer.d.ts +15 -0
  25. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/parse.d.ts +14 -11
  26. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/regexes.d.ts +5 -0
  27. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/schemas.d.ts +126 -35
  28. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/to-json-schema.d.ts +45 -5
  29. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/util.d.ts +81 -1
  30. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/versions.d.ts +1 -1
  31. package/dist/_types/@internal_voice/dist/_types/zod/v4/index.d.cts +2 -2
  32. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/bn.d.ts +4 -0
  33. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ckb.d.ts +4 -0
  34. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/gu.d.ts +4 -0
  35. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/hi.d.ts +4 -0
  36. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/index.d.ts +11 -0
  37. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/kn.d.ts +4 -0
  38. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ne.d.ts +4 -0
  39. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/nn.d.ts +4 -0
  40. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/pt-BR.d.ts +4 -0
  41. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/sk.d.ts +4 -0
  42. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/tg.d.ts +4 -0
  43. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/tk.d.ts +4 -0
  44. package/dist/_types/@internal_voice/dist/index.d.ts +2 -2
  45. package/dist/_types/@internal_voice/dist/voice/aisdk/speech.d.ts +1 -1
  46. package/dist/_types/@internal_voice/dist/voice/aisdk/transcription.d.ts +1 -1
  47. package/dist/_types/@internal_voice/dist/voice/composite-voice.d.ts +2 -2
  48. package/dist/_types/@internal_voice/dist/voice/voice.d.ts +2 -2
  49. package/dist/_types/@internal_voice/package.json +1 -0
  50. package/dist/docs/SKILL.md +1 -1
  51. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  52. package/dist/docs/references/integrations-voice-google.md +6 -0
  53. package/dist/docs/references/reference-voice-overview.md +25 -0
  54. package/dist/index.cjs +5 -5
  55. package/dist/index.cjs.map +1 -1
  56. package/dist/index.d.ts +1 -1
  57. package/dist/index.js.map +1 -1
  58. package/package.json +9 -10
  59. package/dist/_types/@internal_voice/dist/_types/zod/v3/index.d.cts +0 -4
@@ -1,10 +1,10 @@
1
1
  import { JSONSchema7 } from 'json-schema';
2
2
  import { ServerResponse } from 'node:http';
3
3
  import { ServerResponse as ServerResponse_2 } from 'http';
4
- import { z } from '../../zod/v4/index.d.cts';
5
- import * as z3 from '../../zod/v3/index.d.cts';
6
- import * as z4 from '../../zod/v4/index.d.cts';
7
- import { ZodType } from '../../zod/v4/index.d.cts';
4
+ import { z } from '../../zod/v4/index.cjs';
5
+ import * as z3 from '../../zod/v3/index.cjs';
6
+ import * as z4 from '../../zod/v4/index.cjs';
7
+ import { ZodType } from '../../zod/v4/index.cjs';
8
8
 
9
9
  export declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
10
10
  readonly id: string;
@@ -19,7 +19,11 @@ export declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
19
19
  private onData?;
20
20
  private sendAutomaticallyWhen?;
21
21
  private activeResponse;
22
+ private activeResumeRequest;
23
+ private resumableStreamState;
22
24
  private jobExecutor;
25
+ private activeStopCount;
26
+ private stopGeneration;
23
27
  constructor({ generateId, id, transport, messageMetadataSchema, dataPartSchemas, state, onError, onToolCall, onFinish, onData, sendAutomaticallyWhen, }: Omit<ChatInit<UI_MESSAGE>, 'messages'> & {
24
28
  state: ChatState<UI_MESSAGE>;
25
29
  });
@@ -105,10 +109,14 @@ export declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
105
109
  errorText: string;
106
110
  }) => Promise<void>;
107
111
  /**
108
- * Abort the current request immediately, keep the generated tokens if any.
112
+ * Abort the current request, keep the generated tokens if any, and wait for
113
+ * the request pipeline to finish.
109
114
  */
110
115
  stop: () => Promise<void>;
116
+ private shouldSendAutomatically;
117
+ private runAutomaticRequest;
111
118
  private makeRequest;
119
+ private makeRequestImpl;
112
120
  }
113
121
 
114
122
  declare namespace _ai_sdk_provider_utils {
@@ -121,6 +129,7 @@ declare namespace _ai_sdk_provider_utils {
121
129
  DataContent,
122
130
  DelayedPromise,
123
131
  DownloadError_2 as DownloadError,
132
+ EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL as EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL,
124
133
  FetchFunction,
125
134
  FilePart,
126
135
  FlexibleSchema,
@@ -142,6 +151,9 @@ declare namespace _ai_sdk_provider_utils {
142
151
  Resolvable,
143
152
  ResponseHandler,
144
153
  Schema,
154
+ StreamingToolCallDelta,
155
+ StreamingToolCallTracker,
156
+ StreamingToolCallTrackerOptions,
145
157
  SystemModelMessage,
146
158
  TextPart,
147
159
  Tool,
@@ -179,6 +191,7 @@ declare namespace _ai_sdk_provider_utils {
179
191
  dynamicTool,
180
192
  executeTool,
181
193
  extractResponseHeaders,
194
+ fetchWithValidatedEndpoint,
182
195
  fetchWithValidatedRedirects,
183
196
  generateId,
184
197
  getErrorMessage,
@@ -598,6 +611,7 @@ export declare interface ChatTransport<UI_MESSAGE extends UIMessage> {
598
611
  *
599
612
  * @param options - Configuration object containing:
600
613
  * @param options.chatId - Unique identifier for the chat session to reconnect to
614
+ * @param options.abortSignal - Signal to abort the reconnection request if needed
601
615
  * @param options.headers - Additional HTTP headers to include in the reconnection request
602
616
  * @param options.body - Additional JSON properties to include in the request body
603
617
  * @param options.metadata - Custom metadata to attach to the request
@@ -611,6 +625,8 @@ export declare interface ChatTransport<UI_MESSAGE extends UIMessage> {
611
625
  reconnectToStream: (options: {
612
626
  /** Unique identifier for the chat session to reconnect to */
613
627
  chatId: string;
628
+ /** Signal to abort the reconnection request if needed */
629
+ abortSignal?: AbortSignal;
614
630
  } & ChatRequestOptions) => Promise<ReadableStream<UIMessageChunk> | null>;
615
631
  }
616
632
 
@@ -646,9 +662,10 @@ export declare type CompletionRequestOptions = {
646
662
  * @param {ReadableStream} stream - The ReadableStream to be consumed.
647
663
  * @returns {Promise<void>} A promise that resolves when the stream is fully consumed.
648
664
  */
649
- export declare function consumeStream({ stream, onError, }: {
665
+ export declare function consumeStream({ stream, onError, abortSignal, }: {
650
666
  stream: ReadableStream;
651
667
  onError?: (error: unknown) => void;
668
+ abortSignal?: AbortSignal;
652
669
  }): Promise<void>;
653
670
 
654
671
  declare type ConsumeStreamOptions = {
@@ -919,7 +936,7 @@ export declare type CreateUIMessage<UI_MESSAGE extends UIMessage> = Omit<UI_MESS
919
936
  export declare function createUIMessageStream<UI_MESSAGE extends UIMessage>({ execute, onError, // prevent leaking server error details to the client by default
920
937
  originalMessages, onFinish, generateId, }: {
921
938
  execute: (options: {
922
- writer: UIMessageStreamWriter<UI_MESSAGE>;
939
+ writer: UIMessageStreamWriterWithOutcome<UI_MESSAGE>;
923
940
  }) => Promise<void> | void;
924
941
  onError?: (error: unknown) => string;
925
942
  /**
@@ -931,7 +948,7 @@ export declare function createUIMessageStream<UI_MESSAGE extends UIMessage>({ ex
931
948
  generateId?: IdGenerator;
932
949
  }): ReadableStream<InferUIMessageChunk<UI_MESSAGE>>;
933
950
 
934
- export declare function createUIMessageStreamResponse({ status, statusText, headers, stream, consumeSseStream, }: UIMessageStreamResponseInit & {
951
+ export declare function createUIMessageStreamResponse({ status, statusText, headers, stream, keepAliveMs, consumeSseStream, }: UIMessageStreamResponseInit & {
935
952
  stream: ReadableStream<UIMessageChunk>;
936
953
  }): Response;
937
954
 
@@ -1152,6 +1169,13 @@ export declare type DynamicToolResult = {
1152
1169
 
1153
1170
  export declare type DynamicToolUIPart = {
1154
1171
  type: 'dynamic-tool';
1172
+ /**
1173
+ * `false` when a static tool part was normalized to a dynamic tool part
1174
+ * because its current tool schema was unavailable or incompatible.
1175
+ *
1176
+ * This preserves its static origin across persistence boundaries.
1177
+ */
1178
+ dynamic?: false;
1155
1179
  /**
1156
1180
  * Name of the tool that is being called.
1157
1181
  */
@@ -1168,6 +1192,13 @@ export declare type DynamicToolUIPart = {
1168
1192
  } & ({
1169
1193
  state: 'input-streaming';
1170
1194
  input: unknown | undefined;
1195
+ /**
1196
+ * The raw tool input text received so far.
1197
+ *
1198
+ * This is used to continue input streaming when a message is persisted
1199
+ * and later resumed.
1200
+ */
1201
+ rawInput?: string;
1171
1202
  output?: never;
1172
1203
  errorText?: never;
1173
1204
  } | {
@@ -1244,6 +1275,14 @@ export declare function embed<VALUE = string>({ model: modelArg, value, provider
1244
1275
  */
1245
1276
  export declare type Embedding = EmbeddingModelV2Embedding;
1246
1277
 
1278
+ /**
1279
+ * Symbol for exposing the UTF-8 input byte budget of an embedding model.
1280
+ *
1281
+ * This capability is experimental and intentionally lives outside the versioned
1282
+ * embedding model specification.
1283
+ */
1284
+ declare const EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL: unique symbol;
1285
+
1247
1286
  /**
1248
1287
  Embedding model that is used by the AI SDK Core functions.
1249
1288
  */
@@ -1363,8 +1402,9 @@ declare type EmbeddingModelV2Embedding = Array<number>;
1363
1402
  Embed several values using an embedding model. The type of the value is defined
1364
1403
  by the embedding model.
1365
1404
 
1366
- `embedMany` automatically splits large requests into smaller chunks if the model
1367
- has a limit on how many embeddings can be generated in a single call.
1405
+ `embedMany` automatically splits large requests into smaller chunks when the
1406
+ model has a limit on either the number of embeddings or the UTF-8 input bytes
1407
+ that can be processed in a single call.
1368
1408
 
1369
1409
  @param model - The embedding model to use.
1370
1410
  @param values - The values that should be embedded.
@@ -1668,7 +1708,7 @@ export declare type Experimental_AgentSettings<TOOLS extends ToolSet, OUTPUT = n
1668
1708
  /**
1669
1709
  Optional specification for parsing structured outputs from the LLM response.
1670
1710
  */
1671
- experimental_output?: Output_2<OUTPUT, OUTPUT_PARTIAL>;
1711
+ experimental_output?: OutputInterface<OUTPUT, OUTPUT_PARTIAL>;
1672
1712
  /**
1673
1713
  * @deprecated Use `prepareStep` instead.
1674
1714
  */
@@ -1748,7 +1788,7 @@ export declare type Experimental_DownloadFunction = (options: Array<{
1748
1788
  @param seed - Seed for the image generation.
1749
1789
  @param providerOptions - Additional provider-specific options that are passed through to the provider
1750
1790
  as body parameters.
1751
- @param maxRetries - Maximum number of retries. Set to 0 to disable retries. Default: 2.
1791
+ @param maxRetries - Maximum number of retries per image model call, including retries after unclassified empty responses. Empty responses marked as not retryable by the provider are not retried. Set to 0 to disable retries. Default: 2.
1752
1792
  @param abortSignal - An optional abort signal that can be used to cancel the call.
1753
1793
  @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
1754
1794
 
@@ -1799,7 +1839,9 @@ export declare function experimental_generateImage({ model: modelArg, prompt, n,
1799
1839
  */
1800
1840
  providerOptions?: ProviderOptions;
1801
1841
  /**
1802
- Maximum number of retries per embedding model call. Set to 0 to disable retries.
1842
+ Maximum number of retries per image model call, including retries after
1843
+ unclassified empty responses. Empty responses marked as not retryable by the
1844
+ provider are not retried. Set to 0 to disable retries.
1803
1845
 
1804
1846
  @default 2
1805
1847
  */
@@ -2090,6 +2132,26 @@ declare function extractResponseHeaders(response: Response): {
2090
2132
  */
2091
2133
  declare type FetchFunction = typeof globalThis.fetch;
2092
2134
 
2135
+ /**
2136
+ * Fetches one validated URL without following redirects.
2137
+ *
2138
+ * On Node.js, the default fetch validates and pins DNS results at connect time.
2139
+ * An injected fetch is responsible for equivalent connect-time validation.
2140
+ * Redirects are rejected by default. Callers using `redirect: 'manual'` must
2141
+ * validate the Location target before issuing another request.
2142
+ */
2143
+ declare function fetchWithValidatedEndpoint({ url, init, fetch: customFetch, trustedOrigin, redirect, }: {
2144
+ url: string | URL;
2145
+ init?: RequestInit;
2146
+ fetch?: FetchFunction;
2147
+ /**
2148
+ * A developer-configured origin that may legitimately resolve to a private
2149
+ * address. This must never be derived from untrusted response data.
2150
+ */
2151
+ trustedOrigin?: string;
2152
+ redirect?: 'error' | 'manual';
2153
+ }): Promise<Response>;
2154
+
2093
2155
  /**
2094
2156
  * Fetches a URL while enforcing the SSRF download guard on every hop.
2095
2157
  *
@@ -2107,17 +2169,35 @@ declare type FetchFunction = typeof globalThis.fetch;
2107
2169
  * runtime we cannot validate the hop, so we fail closed rather than follow it
2108
2170
  * blindly and bypass the SSRF guard.
2109
2171
  *
2172
+ * A hop that is same-origin with `trustedOrigin` (the developer-configured
2173
+ * endpoint) skips target validation: that origin is exactly what an
2174
+ * unvalidated, config-derived request would fetch anyway, and validating it
2175
+ * would break legitimate self-hosted / localhost deployments whose response
2176
+ * URLs point back at the configured host. Hops on any other origin are always
2177
+ * validated.
2178
+ *
2110
2179
  * The returned response is the final (non-redirect) response. The caller is
2111
2180
  * responsible for checking `response.ok` and reading the body.
2112
2181
  *
2182
+ * On Node.js, the default fetch resolves every hostname through a validating
2183
+ * lookup hook and passes those exact addresses to the connector, preventing
2184
+ * hostname-to-private-IP and DNS-rebinding bypasses. Other runtimes should
2185
+ * constrain egress at the network layer when handling untrusted URLs.
2186
+ *
2113
2187
  * @throws DownloadError if a hop is unsafe, the redirect limit is exceeded, or
2114
2188
  * a redirect cannot be validated on a non-browser runtime.
2115
2189
  */
2116
- declare function fetchWithValidatedRedirects({ url, headers, abortSignal, maxRedirects, }: {
2190
+ declare function fetchWithValidatedRedirects({ url, headers, abortSignal, maxRedirects, fetch: customFetch, trustedOrigin, }: {
2117
2191
  url: string;
2118
2192
  headers?: HeadersInit;
2119
2193
  abortSignal?: AbortSignal;
2120
2194
  maxRedirects?: number;
2195
+ fetch?: FetchFunction;
2196
+ /**
2197
+ * A developer-configured origin whose hops skip target validation. Must
2198
+ * never be derived from response data.
2199
+ */
2200
+ trustedOrigin?: string;
2121
2201
  }): Promise<Response>;
2122
2202
 
2123
2203
  /**
@@ -2202,7 +2282,7 @@ declare interface GatewayCreditsResponse {
2202
2282
  totalUsed: string;
2203
2283
  }
2204
2284
 
2205
- declare type GatewayEmbeddingModelId = 'alibaba/qwen3-embedding-0.6b' | 'alibaba/qwen3-embedding-4b' | 'alibaba/qwen3-embedding-8b' | 'amazon/titan-embed-text-v2' | 'cohere/embed-v4.0' | 'google/gemini-embedding-001' | 'google/gemini-embedding-2' | 'google/text-embedding-005' | 'google/text-multilingual-embedding-002' | 'mistral/codestral-embed' | 'mistral/mistral-embed' | 'openai/text-embedding-3-large' | 'openai/text-embedding-3-small' | 'openai/text-embedding-ada-002' | 'voyage/voyage-3-large' | 'voyage/voyage-3.5' | 'voyage/voyage-3.5-lite' | 'voyage/voyage-4' | 'voyage/voyage-4-large' | 'voyage/voyage-4-lite' | 'voyage/voyage-code-2' | 'voyage/voyage-code-3' | 'voyage/voyage-finance-2' | 'voyage/voyage-law-2' | (string & {});
2285
+ declare type GatewayEmbeddingModelId = 'alibaba/qwen3-embedding-0.6b' | 'alibaba/qwen3-embedding-4b' | 'alibaba/qwen3-embedding-8b' | 'amazon/titan-embed-text-v2' | 'cohere/embed-v4.0' | 'cohere/embed-v5.0-fast' | 'cohere/embed-v5.0-pro' | 'google/gemini-embedding-001' | 'google/gemini-embedding-2' | 'google/text-embedding-005' | 'google/text-multilingual-embedding-002' | 'mistral/codestral-embed' | 'mistral/mistral-embed' | 'openai/text-embedding-3-large' | 'openai/text-embedding-3-small' | 'openai/text-embedding-ada-002' | 'perplexity/pplx-embed-v1-0.6b' | 'perplexity/pplx-embed-v1-4b' | 'voyage/voyage-3-large' | 'voyage/voyage-3.5' | 'voyage/voyage-3.5-lite' | 'voyage/voyage-4' | 'voyage/voyage-4-large' | 'voyage/voyage-4-lite' | 'voyage/voyage-code-2' | 'voyage/voyage-code-3' | 'voyage/voyage-finance-2' | 'voyage/voyage-law-2' | (string & {});
2206
2286
 
2207
2287
  declare interface GatewayFetchMetadataResponse {
2208
2288
  models: GatewayLanguageModelEntry[];
@@ -2252,7 +2332,7 @@ declare interface GatewayGenerationInfoParams {
2252
2332
  id: string;
2253
2333
  }
2254
2334
 
2255
- 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-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' | 'google/imagen-4.0-fast-generate-001' | 'google/imagen-4.0-generate-001' | 'google/imagen-4.0-ultra-generate-001' | 'openai/gpt-image-1' | 'openai/gpt-image-1-mini' | 'openai/gpt-image-1.5' | 'openai/gpt-image-2' | '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-pro' | 'recraft/recraft-v4.1-utility' | 'recraft/recraft-v4.1-utility-pro' | 'xai/grok-imagine-image' | (string & {});
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 & {});
2256
2336
 
2257
2337
  declare interface GatewayLanguageModelEntry {
2258
2338
  /**
@@ -2303,7 +2383,7 @@ declare interface GatewayLanguageModelEntry {
2303
2383
 
2304
2384
  declare type GatewayLanguageModelSpecification = Pick<LanguageModelV2, 'specificationVersion' | 'provider' | 'modelId'>;
2305
2385
 
2306
- export declare type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen-3.6-max-preview' | 'alibaba/qwen3-235b-a22b-thinking' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-235b-a22b-instruct' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-fable-5' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.8' | 'anthropic/claude-opus-4.8-fast' | 'anthropic/claude-opus-5' | 'anthropic/claude-opus-5-fast' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.6' | 'anthropic/claude-sonnet-5' | 'arcee-ai/trinity-large-thinking' | 'arcee-ai/trinity-mini' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-pro' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-pro' | 'google/gemini-3-flash' | 'google/gemini-3-pro-image' | 'google/gemini-3-pro-preview' | '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-image' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.5-flash' | 'google/gemini-3.5-flash-lite' | 'google/gemini-3.6-flash' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'inclusionai/ling-3.0-flash-free' | 'interfaze/interfaze-beta' | 'kwaipilot/kat-coder-air-v2.5' | 'kwaipilot/kat-coder-pro-v1' | 'kwaipilot/kat-coder-pro-v2' | 'kwaipilot/kat-coder-pro-v2.5' | '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-spark-1.1' | '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/devstral-2' | 'mistral/devstral-small-2' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-medium' | 'mistral/mistral-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/pixtral-12b' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-thinking' | '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-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-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-search-preview' | 'openai/gpt-5' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | 'openai/gpt-5.1-codex' | 'openai/gpt-5.1-codex-max' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1-instant' | 'openai/gpt-5.1-thinking' | 'openai/gpt-5.2' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-chat' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.4' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-pro' | 'openai/gpt-5.6-luna' | 'openai/gpt-5.6-sol' | 'openai/gpt-5.6-terra' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-deep-research' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning-pro' | 'poolside/laguna-s-2.1' | 'poolside/laguna-s-2.1-free' | 'sakana/fugu-ultra' | 'stepfun/step-3.5-flash' | 'stepfun/step-3.7-flash' | 'tencent/hy3' | 'thinkingmachines/inkling' | 'xai/grok-4.1-fast-non-reasoning' | 'xai/grok-4.1-fast-reasoning' | 'xai/grok-4.20-multi-agent' | 'xai/grok-4.20-multi-agent-beta' | 'xai/grok-4.20-non-reasoning' | 'xai/grok-4.20-non-reasoning-beta' | 'xai/grok-4.20-reasoning' | 'xai/grok-4.20-reasoning-beta' | 'xai/grok-4.3' | 'xai/grok-4.5' | 'xai/grok-build-0.1' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-pro' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.6v' | 'zai/glm-4.6v-flash' | '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-5v-turbo' | (string & {});
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 & {});
2307
2387
 
2308
2388
  declare interface GatewayProvider extends ProviderV2 {
2309
2389
  (modelId: GatewayModelId): LanguageModelV2;
@@ -2748,7 +2828,7 @@ export declare function generateText<TOOLS extends ToolSet, OUTPUT = never, OUTP
2748
2828
  /**
2749
2829
  Optional specification for parsing structured outputs from the LLM response.
2750
2830
  */
2751
- experimental_output?: Output_2<OUTPUT, OUTPUT_PARTIAL>;
2831
+ experimental_output?: OutputInterface<OUTPUT, OUTPUT_PARTIAL>;
2752
2832
  /**
2753
2833
  Custom download function to use for URLs.
2754
2834
 
@@ -3117,6 +3197,11 @@ declare type ImageModelV2 = {
3117
3197
  be returned as binary data.
3118
3198
  */
3119
3199
  images: Array<string> | Array<Uint8Array>;
3200
+ /**
3201
+ Whether an unsuccessful result, such as an empty image result, can be
3202
+ retried. When omitted, the result is unclassified.
3203
+ */
3204
+ isRetryable?: boolean;
3120
3205
  /**
3121
3206
  Warnings for the call, e.g. unsupported settings.
3122
3207
  */
@@ -3425,6 +3510,8 @@ export declare function isDataUIPart<DATA_TYPES extends UIDataTypes>(part: UIMes
3425
3510
  */
3426
3511
  export declare function isDeepEqualData(obj1: any, obj2: any): boolean;
3427
3512
 
3513
+ export declare function isDynamicToolUIPart(part: UIMessagePart<UIDataTypes, UITools>): part is DynamicToolUIPart;
3514
+
3428
3515
  /**
3429
3516
  * Type guard to check if a message part is a file part.
3430
3517
  */
@@ -3837,6 +3924,13 @@ declare interface LanguageModelV2FilePart {
3837
3924
  File data. Can be a Uint8Array, base64 encoded data as a string or a URL.
3838
3925
  */
3839
3926
  data: LanguageModelV2DataContent;
3927
+ /**
3928
+ * The original URL string before it was parsed into a `URL`.
3929
+ *
3930
+ * This is available when parsing would change the string and a provider
3931
+ * needs to preserve an opaque non-HTTP URI exactly.
3932
+ */
3933
+ originalUrl?: string;
3840
3934
  /**
3841
3935
  IANA media type of the file.
3842
3936
 
@@ -4409,9 +4503,11 @@ declare type LanguageModelV2Usage = {
4409
4503
  };
4410
4504
 
4411
4505
  /**
4412
- Check if the message is an assistant message with completed tool calls.
4413
- The last step of the message must have at least one tool invocation and
4414
- all tool invocations must have a result.
4506
+ * Check if the last message is an assistant message with completed tool calls.
4507
+ * The last step of the message must have at least one tool invocation and
4508
+ * all tool invocations must have a result. Completed model text may follow
4509
+ * the tool invocation because client-side tool results update parts in place,
4510
+ * but trailing text without a completed stream state prevents resubmission.
4415
4511
  */
4416
4512
  export declare function lastAssistantMessageIsCompleteWithToolCalls({ messages, }: {
4417
4513
  messages: UIMessage[];
@@ -4726,7 +4822,7 @@ export declare namespace Output {
4726
4822
  };
4727
4823
  }
4728
4824
 
4729
- declare interface Output_2<OUTPUT, PARTIAL> {
4825
+ export declare interface OutputInterface<OUTPUT, PARTIAL> {
4730
4826
  readonly type: 'object' | 'text';
4731
4827
  responseFormat: LanguageModelV2CallOptions['responseFormat'];
4732
4828
  parsePartial(options: {
@@ -5089,7 +5185,7 @@ export declare function pipeTextStreamToResponse({ response, status, statusText,
5089
5185
  textStream: ReadableStream<string>;
5090
5186
  } & ResponseInit): Promise<void>;
5091
5187
 
5092
- export declare function pipeUIMessageStreamToResponse({ response, status, statusText, headers, stream, consumeSseStream, }: {
5188
+ export declare function pipeUIMessageStreamToResponse({ response, status, statusText, headers, stream, keepAliveMs, consumeSseStream, }: {
5093
5189
  response: ServerResponse;
5094
5190
  stream: ReadableStream<UIMessageChunk>;
5095
5191
  } & UIMessageStreamResponseInit): Promise<void>;
@@ -5484,6 +5580,10 @@ declare interface ReasoningPart {
5484
5580
  */
5485
5581
  export declare type ReasoningUIPart = {
5486
5582
  type: 'reasoning';
5583
+ /**
5584
+ * The identifier of the reasoning part.
5585
+ */
5586
+ id?: string;
5487
5587
  /**
5488
5588
  * The reasoning text.
5489
5589
  */
@@ -5606,16 +5706,7 @@ declare function safeValidateTypes<OBJECT>({ value, schema, }: {
5606
5706
  * but instead of throwing it returns `{ success: true, data }`
5607
5707
  * or `{ success: false, error }`.
5608
5708
  */
5609
- export declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>({ messages, metadataSchema, dataSchemas, tools, }: {
5610
- messages: unknown;
5611
- metadataSchema?: Validator<UIMessage['metadata']> | StandardSchemaV1<unknown, UI_MESSAGE['metadata']>;
5612
- dataSchemas?: {
5613
- [NAME in keyof InferUIMessageData<UI_MESSAGE> & string]?: Validator<InferUIMessageData<UI_MESSAGE>[NAME]> | StandardSchemaV1<unknown, InferUIMessageData<UI_MESSAGE>[NAME]>;
5614
- };
5615
- tools?: {
5616
- [NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: Tool<InferUIMessageTools<UI_MESSAGE>[NAME]['input'], InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
5617
- };
5618
- }): Promise<SafeValidateUIMessagesResult<UI_MESSAGE>>;
5709
+ export declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>({ messages, metadataSchema, dataSchemas, tools, }: ValidateUIMessagesOptions<UI_MESSAGE>): Promise<SafeValidateUIMessagesResult<UI_MESSAGE>>;
5619
5710
 
5620
5711
  export declare type SafeValidateUIMessagesResult<UI_MESSAGE extends UIMessage> = {
5621
5712
  success: true;
@@ -5648,8 +5739,10 @@ declare const schemaSymbol: unique symbol;
5648
5739
  export declare class SerialJobExecutor {
5649
5740
  private queue;
5650
5741
  private isProcessing;
5742
+ private idleWaiters;
5651
5743
  private processQueue;
5652
5744
  run(job: Job): Promise<void>;
5745
+ waitForIdle(): Promise<void>;
5653
5746
  }
5654
5747
 
5655
5748
  declare type SharedV2Headers = Record<string, string>;
@@ -5801,7 +5894,7 @@ declare type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
5801
5894
  /**
5802
5895
  * Smooths text streaming output.
5803
5896
  *
5804
- * @param delayInMs - The delay in milliseconds between each chunk. Defaults to 10ms. Can be set to `null` to skip the delay.
5897
+ * @param delayInMs - The delay in milliseconds between each chunk. Defaults to 10ms. Can be set to `null` to skip the delay. The delay is skipped while the document is hidden (e.g. browser background tabs), where timer throttling would otherwise stall the stream.
5805
5898
  * @param chunking - Controls how the text is chunked for streaming. Use "word" to stream word by word (default), "line" to stream line by line, or provide a custom RegExp pattern for custom chunking.
5806
5899
  *
5807
5900
  * @returns A transform stream that smooths text streaming output.
@@ -6563,6 +6656,76 @@ export declare type StopCondition<TOOLS extends ToolSet> = (options: {
6563
6656
  steps: Array<StepResult<TOOLS>>;
6564
6657
  }) => PromiseLike<boolean> | boolean;
6565
6658
 
6659
+ /**
6660
+ * Minimal interface for a streaming tool call delta from an OpenAI-compatible API.
6661
+ */
6662
+ declare interface StreamingToolCallDelta {
6663
+ index?: number | null;
6664
+ id?: string | null;
6665
+ type?: string | null;
6666
+ function?: {
6667
+ name?: string | null;
6668
+ arguments?: string | null;
6669
+ } | null;
6670
+ }
6671
+
6672
+ /**
6673
+ * Tracks streaming tool call state across multiple deltas from an
6674
+ * OpenAI-compatible chat completion stream.
6675
+ */
6676
+ declare class StreamingToolCallTracker<DELTA extends StreamingToolCallDelta = StreamingToolCallDelta> {
6677
+ private toolCalls;
6678
+ private toolCallsById;
6679
+ private toolCallsByIndex;
6680
+ private usedToolCallIds;
6681
+ private nextGeneratedIdSuffixes;
6682
+ private readonly controller;
6683
+ private readonly _generateId;
6684
+ private readonly typeValidation;
6685
+ private readonly extractMetadata?;
6686
+ private readonly buildToolCallProviderMetadata?;
6687
+ constructor(controller: StreamingToolCallTrackerController, options?: StreamingToolCallTrackerOptions<DELTA>);
6688
+ processDelta(toolCallDelta: DELTA): void;
6689
+ flush(): void;
6690
+ private resolveToolCall;
6691
+ private filterToolCallsByName;
6692
+ private resolveMatchingToolCall;
6693
+ private processNewToolCall;
6694
+ private associateWireId;
6695
+ private associateIndex;
6696
+ private createToolCallId;
6697
+ private getNonBlankString;
6698
+ private processExistingToolCall;
6699
+ private finishToolCall;
6700
+ }
6701
+
6702
+ declare type StreamingToolCallTrackerController = Pick<TransformStreamDefaultController<LanguageModelV2StreamPart>, 'enqueue'>;
6703
+
6704
+ declare interface StreamingToolCallTrackerOptions<DELTA extends StreamingToolCallDelta = StreamingToolCallDelta> {
6705
+ /**
6706
+ * ID generator function for tool call IDs.
6707
+ * Blank or repeated outputs are converted to usable unique IDs.
6708
+ * Defaults to the standard generateId.
6709
+ */
6710
+ generateId?: () => string;
6711
+ /**
6712
+ * How to validate the `type` field on new tool call deltas.
6713
+ * - `'none'`: no validation (default)
6714
+ * - `'if-present'`: throw if type is present and not `'function'`
6715
+ * - `'required'`: throw if type is not exactly `'function'`
6716
+ */
6717
+ typeValidation?: 'none' | 'if-present' | 'required';
6718
+ /**
6719
+ * Extract provider-specific metadata from a tool call delta.
6720
+ * Called once when a new tool call is detected.
6721
+ */
6722
+ extractMetadata?: (delta: DELTA) => SharedV2ProviderMetadata | undefined;
6723
+ /**
6724
+ * Build the `providerMetadata` object for a `tool-call` event.
6725
+ */
6726
+ buildToolCallProviderMetadata?: (metadata: SharedV2ProviderMetadata | undefined) => SharedV2ProviderMetadata | undefined;
6727
+ }
6728
+
6566
6729
  /**
6567
6730
  Generate a structured, typed object for a given prompt and schema using a language model.
6568
6731
 
@@ -6934,7 +7097,7 @@ export declare function streamText<TOOLS extends ToolSet, OUTPUT = never, PARTIA
6934
7097
  /**
6935
7098
  Optional specification for parsing structured outputs from the LLM response.
6936
7099
  */
6937
- experimental_output?: Output_2<OUTPUT, PARTIAL_OUTPUT>;
7100
+ experimental_output?: OutputInterface<OUTPUT, PARTIAL_OUTPUT>;
6938
7101
  /**
6939
7102
  Optional function that you can use to provide different settings for a step.
6940
7103
 
@@ -8348,6 +8511,10 @@ export declare type UIMessageStreamOnFinishCallback<UI_MESSAGE extends UIMessage
8348
8511
  * Indicates whether the stream was aborted.
8349
8512
  */
8350
8513
  isAborted: boolean;
8514
+ /**
8515
+ * The operation-level outcome of the stream.
8516
+ */
8517
+ outcome: UIMessageStreamOutcome;
8351
8518
  /**
8352
8519
  * The message that was sent to the client as a response
8353
8520
  * (including the original message if it was extended).
@@ -8413,7 +8580,31 @@ export declare type UIMessageStreamOptions<UI_MESSAGE extends UIMessage> = {
8413
8580
  onError?: (error: unknown) => string;
8414
8581
  };
8415
8582
 
8583
+ /**
8584
+ * The operation-level outcome of a UI message stream.
8585
+ *
8586
+ * This is separate from model finish reasons and individual stream chunks.
8587
+ * Fatal stream-processing failures override outcomes declared by the stream
8588
+ * owner.
8589
+ */
8590
+ export declare type UIMessageStreamOutcome = {
8591
+ status: 'completed';
8592
+ } | {
8593
+ status: 'failed';
8594
+ error?: unknown;
8595
+ } | {
8596
+ status: 'aborted';
8597
+ } | {
8598
+ status: 'unknown';
8599
+ };
8600
+
8416
8601
  declare type UIMessageStreamResponseInit = ResponseInit & {
8602
+ /**
8603
+ * Optional interval in milliseconds for sending SSE keep-alive comments.
8604
+ * When set, an opening comment is sent immediately and additional comments
8605
+ * are sent after the stream has been idle for the configured interval.
8606
+ */
8607
+ keepAliveMs?: number;
8417
8608
  consumeSseStream?: (options: {
8418
8609
  stream: ReadableStream<string>;
8419
8610
  }) => PromiseLike<void> | void;
@@ -8436,6 +8627,18 @@ export declare interface UIMessageStreamWriter<UI_MESSAGE extends UIMessage = UI
8436
8627
  onError: ErrorHandler | undefined;
8437
8628
  }
8438
8629
 
8630
+ export declare interface UIMessageStreamWriterWithOutcome<UI_MESSAGE extends UIMessage = UIMessage> extends UIMessageStreamWriter<UI_MESSAGE> {
8631
+ /**
8632
+ * Declares the operation-level outcome of the composed stream.
8633
+ *
8634
+ * The first outcome declared through this method is retained. Fatal
8635
+ * execution, merge, error-handling, or downstream processing failures
8636
+ * override declared outcomes. Declaring an outcome does not write a chunk or
8637
+ * close the stream.
8638
+ */
8639
+ setOutcome(outcome: UIMessageStreamOutcome): void;
8640
+ }
8641
+
8439
8642
  export declare type UITool = {
8440
8643
  input: unknown;
8441
8644
  output: unknown | undefined;
@@ -8459,6 +8662,13 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
8459
8662
  state: 'input-streaming';
8460
8663
  input: DeepPartial<asUITool<TOOL>['input']> | undefined;
8461
8664
  providerExecuted?: boolean;
8665
+ /**
8666
+ * The raw tool input text received so far.
8667
+ *
8668
+ * This is used to continue input streaming when a message is persisted
8669
+ * and later resumed.
8670
+ */
8671
+ rawInput?: string;
8462
8672
  output?: never;
8463
8673
  errorText?: never;
8464
8674
  } | {
@@ -8599,9 +8809,8 @@ export declare const userModelMessageSchema: z.ZodType<UserModelMessage>;
8599
8809
  * Validates that a URL is safe to download from, blocking private/internal addresses
8600
8810
  * to prevent SSRF attacks.
8601
8811
  *
8602
- * Note: this performs string/literal-IP checks only. It does not resolve DNS, so a
8603
- * hostname that resolves to a private address is not blocked here (see callers, which
8604
- * should additionally constrain egress at the network layer when handling untrusted URLs).
8812
+ * Note: this function performs string/literal-IP checks only. The Node.js
8813
+ * download fetch additionally validates and pins DNS results at connect time.
8605
8814
  *
8606
8815
  * @param url - The URL string to validate.
8607
8816
  * @throws DownloadError if the URL is unsafe.
@@ -8629,7 +8838,9 @@ declare function validateTypes<OBJECT>({ value, schema, }: {
8629
8838
  * the corresponding schemas are provided. Otherwise, they are assumed to be
8630
8839
  * valid.
8631
8840
  */
8632
- export declare function validateUIMessages<UI_MESSAGE extends UIMessage>({ messages, metadataSchema, dataSchemas, tools, }: {
8841
+ export declare function validateUIMessages<UI_MESSAGE extends UIMessage>(options: ValidateUIMessagesOptions<UI_MESSAGE>): Promise<Array<UI_MESSAGE>>;
8842
+
8843
+ declare type ValidateUIMessagesOptions<UI_MESSAGE extends UIMessage> = {
8633
8844
  messages: unknown;
8634
8845
  metadataSchema?: Validator<UIMessage['metadata']> | StandardSchemaV1<unknown, UI_MESSAGE['metadata']>;
8635
8846
  dataSchemas?: {
@@ -8638,7 +8849,7 @@ export declare function validateUIMessages<UI_MESSAGE extends UIMessage>({ messa
8638
8849
  tools?: {
8639
8850
  [NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: Tool<InferUIMessageTools<UI_MESSAGE>[NAME]['input'], InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
8640
8851
  };
8641
- }): Promise<Array<UI_MESSAGE>>;
8852
+ };
8642
8853
 
8643
8854
  declare type ValidationResult<OBJECT> = {
8644
8855
  success: true;
@@ -8776,5 +8987,5 @@ export declare function zodSchema<OBJECT>(zodSchema: z4.core.$ZodType<OBJECT, an
8776
8987
  }): Schema<OBJECT>;
8777
8988
 
8778
8989
  export { }
8779
- 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, Output_2 as Output_2, 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 };
8780
- export { 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 };
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 };