@ai-sdk/google
Advanced tools
+1
-0
@@ -173,2 +173,3 @@ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils'; | ||
| }[]; | ||
| responseId?: string | null | undefined; | ||
| usageMetadata?: { | ||
@@ -175,0 +176,0 @@ cachedContentTokenCount?: number | null | undefined; |
@@ -211,2 +211,3 @@ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils'; | ||
| }[]; | ||
| responseId?: string | null | undefined; | ||
| usageMetadata?: { | ||
@@ -213,0 +214,0 @@ cachedContentTokenCount?: number | null | undefined; |
+1
-1
| { | ||
| "name": "@ai-sdk/google", | ||
| "version": "4.0.18", | ||
| "version": "4.0.19", | ||
| "type": "module", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -417,3 +417,3 @@ import type { | ||
| // Associates a code execution result with its preceding call. | ||
| // Associates code execution results with their preceding call. | ||
| let lastCodeExecutionToolCallId: string | undefined; | ||
@@ -439,3 +439,3 @@ // Associates a server-side tool response with its preceding call (tool combination). | ||
| type: 'tool-result', | ||
| // Assumes a result directly follows its corresponding call part. | ||
| // Results correspond to the most recent executable code part. | ||
| toolCallId: lastCodeExecutionToolCallId!, | ||
@@ -448,4 +448,2 @@ toolName: 'code_execution', | ||
| }); | ||
| // Clear the ID after use to avoid accidental reuse. | ||
| lastCodeExecutionToolCallId = undefined; | ||
| } else if ('text' in part && part.text != null) { | ||
@@ -575,3 +573,4 @@ const thoughtSignatureMetadata = part.thoughtSignature | ||
| response: { | ||
| // TODO timestamp, model id, id | ||
| // TODO timestamp, model id | ||
| id: response.responseId ?? undefined, | ||
| headers: responseHeaders, | ||
@@ -622,2 +621,3 @@ body: rawResponse, | ||
| let hasToolCalls = false; | ||
| let hasEmittedResponseMetadata = false; | ||
@@ -631,3 +631,3 @@ // Track active blocks to group consecutive parts of same type | ||
| const emittedSourceUrls = new Set<string>(); | ||
| // Associates a code execution result with its preceding call. | ||
| // Associates code execution results with their preceding call. | ||
| let lastCodeExecutionToolCallId: string | undefined; | ||
@@ -702,2 +702,10 @@ // Associates a server-side tool response with its preceding call (tool combination). | ||
| if (!hasEmittedResponseMetadata && value.responseId != null) { | ||
| hasEmittedResponseMetadata = true; | ||
| controller.enqueue({ | ||
| type: 'response-metadata', | ||
| id: value.responseId, | ||
| }); | ||
| } | ||
| const usageMetadata = value.usageMetadata; | ||
@@ -761,3 +769,3 @@ | ||
| ) { | ||
| // Assumes a result directly follows its corresponding call part. | ||
| // Results correspond to the most recent executable code part. | ||
| const toolCallId = lastCodeExecutionToolCallId; | ||
@@ -775,4 +783,2 @@ | ||
| }); | ||
| // Clear the ID after use. | ||
| lastCodeExecutionToolCallId = undefined; | ||
| } | ||
@@ -1543,2 +1549,3 @@ } else if ('text' in part && part.text != null) { | ||
| z.object({ | ||
| responseId: z.string().nullish(), | ||
| candidates: z.array( | ||
@@ -1590,2 +1597,3 @@ z.object({ | ||
| z.object({ | ||
| responseId: z.string().nullish(), | ||
| candidates: z | ||
@@ -1592,0 +1600,0 @@ .array( |
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 too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
2003265
0.11%25299
0.11%