ai 7.0.112 → 7.0.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +315 -213
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +2 -1
- package/dist/internal/index.js +105 -28
- package/dist/internal/index.js.map +1 -1
- package/docs/03-agents/06-tool-approvals.mdx +16 -0
- package/docs/03-ai-sdk-core/37-speech.mdx +2 -0
- package/docs/07-reference/01-ai-sdk-core/12-generate-speech.mdx +1 -1
- package/docs/07-reference/01-ai-sdk-core/32-validate-ui-messages.mdx +18 -0
- package/package.json +11 -11
- package/src/embed/embed-many.ts +18 -2
- package/src/generate-speech/generate-speech.ts +15 -4
- package/src/generate-speech/generated-audio-file.ts +0 -8
- package/src/generate-text/execute-tools-from-stream.ts +0 -2
- package/src/generate-text/generate-text.ts +1 -0
- package/src/generate-text/generated-file.ts +0 -8
- package/src/generate-text/invoke-tool-callbacks-from-stream.ts +9 -8
- package/src/generate-text/output.ts +0 -2
- package/src/generate-text/parse-tool-call.ts +38 -25
- package/src/generate-text/stream-text.ts +1 -0
- package/src/generate-text/to-response-messages.ts +7 -0
- package/src/generate-text/tool-call.ts +26 -0
- package/src/generate-text/validate-tool-approvals.ts +39 -3
- package/src/generate-video/generate-video.ts +0 -2
- package/src/middleware/extract-reasoning-middleware.ts +1 -1
- package/src/middleware/wrap-embedding-model.ts +9 -1
- package/src/model/get-embedding-model-provider-options-transformer.ts +17 -0
- package/src/prompt/content-part.ts +3 -0
- package/src/registry/custom-provider.ts +12 -5
- package/src/ui/chat.ts +108 -17
- package/src/ui/convert-to-model-messages.ts +8 -0
- package/src/ui/direct-chat-transport.ts +2 -0
- package/src/ui/process-ui-message-stream.ts +6 -0
- package/src/ui/ui-messages.ts +10 -0
- package/src/ui/validate-ui-messages.ts +98 -132
- package/src/ui-message-stream/to-ui-message-chunk.ts +7 -0
- package/src/ui-message-stream/ui-message-chunks.ts +2 -0
- package/src/util/write-to-server-response.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 7.0.113
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dcdb011: fix(ai): route completed streamed tool input callbacks to repaired tools
|
|
8
|
+
- 8f72832: fix(ai): preserve video models from legacy fallback providers
|
|
9
|
+
- fe07867: Fix Google `embedMany` calls with more than 100 values by keeping per-value multimodal content aligned across automatic batches, including text-only entries. Validate content length before sending requests and validate each batch's provider options after middleware transforms them.
|
|
10
|
+
- b74c0cb: fix(ai): resume tool approvals from earlier messages
|
|
11
|
+
- a4b0940: fix(ai): execute manually approved tool inputs produced by schema transforms
|
|
12
|
+
|
|
13
|
+
Preserve approved inputs during revalidation and reject histories whose reconstructed schema output differs, including signed approvals with missing original input. Validate transformed UI tool inputs against the reconstructed output before returning them as static tool parts.
|
|
14
|
+
|
|
15
|
+
- 2693319: Add Gemini 3.8 TTS support with structured speech metadata and per-turn speaker and style controls for prebuilt voices. Preserve native WAV responses without adding a second header, support explicit raw PCM, mu-law, and A-law output, and identify headerless audio formats correctly. Add the Gemini 3.8 speech model IDs to Google and Gateway types.
|
|
16
|
+
|
|
17
|
+
Share transcript and custom-voice inspection through the Google provider internal export, and reject empty speech transcripts before sending a request. Default newer and custom model IDs to structured speech while preserving the legacy format for Gemini 2.5 and 3.1.
|
|
18
|
+
|
|
19
|
+
- c93ee90: fix(ai): preserve message history for direct transport stream callbacks
|
|
20
|
+
- 771e74b: chore: enable dead code lint rules
|
|
21
|
+
- Updated dependencies [fe07867]
|
|
22
|
+
- Updated dependencies [a4b0940]
|
|
23
|
+
- Updated dependencies [2693319]
|
|
24
|
+
- Updated dependencies [b73f2f9]
|
|
25
|
+
- Updated dependencies [771e74b]
|
|
26
|
+
- @ai-sdk/provider-utils@5.0.47
|
|
27
|
+
- @ai-sdk/gateway@4.0.91
|
|
28
|
+
|
|
3
29
|
## 7.0.112
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -2186,6 +2186,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
2186
2186
|
reason?: never;
|
|
2187
2187
|
isAutomatic?: boolean;
|
|
2188
2188
|
signature?: string;
|
|
2189
|
+
inputSchemaInput?: unknown;
|
|
2189
2190
|
};
|
|
2190
2191
|
} | {
|
|
2191
2192
|
state: 'approval-responded';
|
|
@@ -2201,6 +2202,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
2201
2202
|
reason?: string;
|
|
2202
2203
|
isAutomatic?: boolean;
|
|
2203
2204
|
signature?: string;
|
|
2205
|
+
inputSchemaInput?: unknown;
|
|
2204
2206
|
};
|
|
2205
2207
|
} | {
|
|
2206
2208
|
state: 'output-available';
|
|
@@ -2218,6 +2220,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
2218
2220
|
reason?: string;
|
|
2219
2221
|
isAutomatic?: boolean;
|
|
2220
2222
|
signature?: string;
|
|
2223
|
+
inputSchemaInput?: unknown;
|
|
2221
2224
|
};
|
|
2222
2225
|
} | {
|
|
2223
2226
|
state: 'output-error';
|
|
@@ -2239,6 +2242,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
2239
2242
|
reason?: string;
|
|
2240
2243
|
isAutomatic?: boolean;
|
|
2241
2244
|
signature?: string;
|
|
2245
|
+
inputSchemaInput?: unknown;
|
|
2242
2246
|
};
|
|
2243
2247
|
} | {
|
|
2244
2248
|
state: 'output-denied';
|
|
@@ -2254,6 +2258,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
2254
2258
|
reason?: string;
|
|
2255
2259
|
isAutomatic?: boolean;
|
|
2256
2260
|
signature?: string;
|
|
2261
|
+
inputSchemaInput?: unknown;
|
|
2257
2262
|
};
|
|
2258
2263
|
});
|
|
2259
2264
|
type ToolUIPart<TOOLS extends UITools = UITools> = ValueOf<{
|
|
@@ -2305,6 +2310,7 @@ type DynamicToolUIPart = {
|
|
|
2305
2310
|
reason?: never;
|
|
2306
2311
|
isAutomatic?: boolean;
|
|
2307
2312
|
signature?: string;
|
|
2313
|
+
inputSchemaInput?: unknown;
|
|
2308
2314
|
};
|
|
2309
2315
|
} | {
|
|
2310
2316
|
state: 'approval-responded';
|
|
@@ -2320,6 +2326,7 @@ type DynamicToolUIPart = {
|
|
|
2320
2326
|
reason?: string;
|
|
2321
2327
|
isAutomatic?: boolean;
|
|
2322
2328
|
signature?: string;
|
|
2329
|
+
inputSchemaInput?: unknown;
|
|
2323
2330
|
};
|
|
2324
2331
|
} | {
|
|
2325
2332
|
state: 'output-available';
|
|
@@ -2337,6 +2344,7 @@ type DynamicToolUIPart = {
|
|
|
2337
2344
|
reason?: string;
|
|
2338
2345
|
isAutomatic?: boolean;
|
|
2339
2346
|
signature?: string;
|
|
2347
|
+
inputSchemaInput?: unknown;
|
|
2340
2348
|
};
|
|
2341
2349
|
} | {
|
|
2342
2350
|
state: 'output-error';
|
|
@@ -2353,6 +2361,7 @@ type DynamicToolUIPart = {
|
|
|
2353
2361
|
reason?: string;
|
|
2354
2362
|
isAutomatic?: boolean;
|
|
2355
2363
|
signature?: string;
|
|
2364
|
+
inputSchemaInput?: unknown;
|
|
2356
2365
|
};
|
|
2357
2366
|
} | {
|
|
2358
2367
|
state: 'output-denied';
|
|
@@ -2368,6 +2377,7 @@ type DynamicToolUIPart = {
|
|
|
2368
2377
|
reason?: string;
|
|
2369
2378
|
isAutomatic?: boolean;
|
|
2370
2379
|
signature?: string;
|
|
2380
|
+
inputSchemaInput?: unknown;
|
|
2371
2381
|
};
|
|
2372
2382
|
});
|
|
2373
2383
|
/**
|
|
@@ -2523,6 +2533,7 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
|
|
|
2523
2533
|
approvalId: string;
|
|
2524
2534
|
toolCallId: string;
|
|
2525
2535
|
approvalDescriptor?: unknown;
|
|
2536
|
+
inputSchemaInput?: unknown;
|
|
2526
2537
|
reason?: string;
|
|
2527
2538
|
isAutomatic?: boolean;
|
|
2528
2539
|
signature?: string;
|
|
@@ -5802,6 +5813,7 @@ declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
5802
5813
|
private onData?;
|
|
5803
5814
|
private sendAutomaticallyWhen?;
|
|
5804
5815
|
private pendingMessagePreparations;
|
|
5816
|
+
private pendingApprovalMessageId;
|
|
5805
5817
|
private activeResponse;
|
|
5806
5818
|
private activeResumeRequest;
|
|
5807
5819
|
private jobExecutor;
|
|
@@ -5871,6 +5883,7 @@ declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
5871
5883
|
*/
|
|
5872
5884
|
stop: () => Promise<void>;
|
|
5873
5885
|
private shouldSendAutomatically;
|
|
5886
|
+
private makeRequestForToolApproval;
|
|
5874
5887
|
private makeRequest;
|
|
5875
5888
|
}
|
|
5876
5889
|
|
|
@@ -6162,6 +6175,9 @@ type ValidateUIMessagesOptions<UI_MESSAGE extends UIMessage> = {
|
|
|
6162
6175
|
outputSchema?: FlexibleSchema<InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
|
|
6163
6176
|
};
|
|
6164
6177
|
};
|
|
6178
|
+
experimental_refineToolInput?: {
|
|
6179
|
+
[NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: (input: InferUIMessageTools<UI_MESSAGE>[NAME]['input']) => MaybePromiseLike<InferUIMessageTools<UI_MESSAGE>[NAME]['input']>;
|
|
6180
|
+
};
|
|
6165
6181
|
};
|
|
6166
6182
|
/**
|
|
6167
6183
|
* Validates a list of UI messages like `validateUIMessages`,
|