+2
-2
| { | ||
| "name": "ai", | ||
| "version": "7.0.64", | ||
| "version": "7.0.65", | ||
| "type": "module", | ||
@@ -45,3 +45,3 @@ "description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.", | ||
| "dependencies": { | ||
| "@ai-sdk/gateway": "4.0.51", | ||
| "@ai-sdk/gateway": "4.0.52", | ||
| "@ai-sdk/provider": "4.0.7", | ||
@@ -48,0 +48,0 @@ "@ai-sdk/provider-utils": "5.0.27" |
@@ -143,7 +143,16 @@ import { | ||
| jsonSchema: async () => { | ||
| // remove $schema from schema.jsonSchema: | ||
| const { $schema: _$schema, ...itemSchema } = await schema.jsonSchema; | ||
| // keep root-level definitions available to root-relative references: | ||
| const { | ||
| $schema: _$schema, | ||
| definitions, | ||
| $defs, | ||
| ...itemSchema | ||
| } = (await schema.jsonSchema) as JSONSchema7 & { | ||
| $defs?: JSONSchema7['definitions']; | ||
| }; | ||
| return { | ||
| $schema: 'http://json-schema.org/draft-07/schema#', | ||
| ...(definitions != null && { definitions }), | ||
| ...($defs != null && { $defs }), | ||
| type: 'object', | ||
@@ -150,0 +159,0 @@ properties: { |
| import { | ||
| TypeValidationError, | ||
| type JSONSchema7, | ||
| type JSONValue, | ||
@@ -220,4 +221,11 @@ type LanguageModelV4CallOptions, | ||
| responseFormat: resolve(elementSchema.jsonSchema).then(jsonSchema => { | ||
| // remove $schema from schema.jsonSchema: | ||
| const { $schema: _$schema, ...itemSchema } = jsonSchema; | ||
| // keep root-level definitions available to root-relative references: | ||
| const { | ||
| $schema: _$schema, | ||
| definitions, | ||
| $defs, | ||
| ...itemSchema | ||
| } = jsonSchema as JSONSchema7 & { | ||
| $defs?: JSONSchema7['definitions']; | ||
| }; | ||
@@ -228,2 +236,4 @@ return { | ||
| $schema: 'http://json-schema.org/draft-07/schema#', | ||
| ...(definitions != null && { definitions }), | ||
| ...($defs != null && { $defs }), | ||
| type: 'object', | ||
@@ -230,0 +240,0 @@ properties: { |
@@ -14,2 +14,31 @@ import type { UIMessage } from '../ui/ui-messages'; | ||
| function createUIMessageSnapshot<UI_MESSAGE extends UIMessage>( | ||
| message: UI_MESSAGE, | ||
| ): UI_MESSAGE { | ||
| const textByPartIndex = new Map<number, string>(); | ||
| const messageWithoutText = { | ||
| ...message, | ||
| parts: message.parts.map((part, index) => { | ||
| if (part.type === 'text' || part.type === 'reasoning') { | ||
| textByPartIndex.set(index, part.text); | ||
| return { ...part, text: '' }; | ||
| } | ||
| return part; | ||
| }), | ||
| }; | ||
| const snapshot = structuredClone(messageWithoutText) as UI_MESSAGE; | ||
| for (const [index, text] of textByPartIndex) { | ||
| const part = snapshot.parts[index]; | ||
| if (part.type === 'text' || part.type === 'reasoning') { | ||
| part.text = text; | ||
| } | ||
| } | ||
| return snapshot; | ||
| } | ||
| /** | ||
@@ -72,3 +101,3 @@ * Transforms a stream of `UIMessageChunk`s into an `AsyncIterableStream` of `UIMessage`s. | ||
| write: () => { | ||
| controller?.enqueue(structuredClone(state.message)); | ||
| controller?.enqueue(createUIMessageSnapshot(state.message)); | ||
| }, | ||
@@ -75,0 +104,0 @@ }); |
+5
-7
@@ -864,11 +864,9 @@ import { | ||
| } | ||
| } catch (err) { | ||
| console.error(err); | ||
| } | ||
| } finally { | ||
| if (this.activeResponse === activeResponse) { | ||
| this.activeResponse = undefined; | ||
| } | ||
| if (this.activeResponse === activeResponse) { | ||
| this.activeResponse = undefined; | ||
| clearActiveResumeRequest(); | ||
| } | ||
| clearActiveResumeRequest(); | ||
| } | ||
@@ -875,0 +873,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
6684701
0.07%69460
0.11%+ Added
- Removed
Updated