@ai-sdk/google 3.0.95 → 3.0.96
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 +6 -0
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -3
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1 -3
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/google-generative-ai-language-model.ts +4 -8
package/package.json
CHANGED
|
@@ -375,7 +375,7 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
|
|
|
375
375
|
|
|
376
376
|
const usageMetadata = response.usageMetadata;
|
|
377
377
|
|
|
378
|
-
// Associates
|
|
378
|
+
// Associates code execution results with their preceding call.
|
|
379
379
|
let lastCodeExecutionToolCallId: string | undefined;
|
|
380
380
|
// Associates a server-side tool response with its preceding call (tool combination).
|
|
381
381
|
let lastServerToolCallId: string | undefined;
|
|
@@ -396,7 +396,7 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
|
|
|
396
396
|
} else if ('codeExecutionResult' in part && part.codeExecutionResult) {
|
|
397
397
|
content.push({
|
|
398
398
|
type: 'tool-result',
|
|
399
|
-
//
|
|
399
|
+
// Results correspond to the most recent executable code part.
|
|
400
400
|
toolCallId: lastCodeExecutionToolCallId!,
|
|
401
401
|
toolName: 'code_execution',
|
|
402
402
|
result: {
|
|
@@ -404,8 +404,6 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
|
|
|
404
404
|
output: part.codeExecutionResult.output ?? '',
|
|
405
405
|
},
|
|
406
406
|
});
|
|
407
|
-
// Clear the ID after use to avoid accidental reuse.
|
|
408
|
-
lastCodeExecutionToolCallId = undefined;
|
|
409
407
|
} else if ('text' in part && part.text != null) {
|
|
410
408
|
const thoughtSignatureMetadata = part.thoughtSignature
|
|
411
409
|
? {
|
|
@@ -600,7 +598,7 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
|
|
|
600
598
|
|
|
601
599
|
// Track emitted sources to prevent duplicates
|
|
602
600
|
const emittedSourceUrls = new Set<string>();
|
|
603
|
-
// Associates
|
|
601
|
+
// Associates code execution results with their preceding call.
|
|
604
602
|
let lastCodeExecutionToolCallId: string | undefined;
|
|
605
603
|
// Associates a server-side tool response with its preceding call (tool combination).
|
|
606
604
|
let lastServerToolCallId: string | undefined;
|
|
@@ -728,7 +726,7 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
|
|
|
728
726
|
'codeExecutionResult' in part &&
|
|
729
727
|
part.codeExecutionResult
|
|
730
728
|
) {
|
|
731
|
-
//
|
|
729
|
+
// Results correspond to the most recent executable code part.
|
|
732
730
|
const toolCallId = lastCodeExecutionToolCallId;
|
|
733
731
|
|
|
734
732
|
if (toolCallId) {
|
|
@@ -741,8 +739,6 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
|
|
|
741
739
|
output: part.codeExecutionResult.output ?? '',
|
|
742
740
|
},
|
|
743
741
|
});
|
|
744
|
-
// Clear the ID after use.
|
|
745
|
-
lastCodeExecutionToolCallId = undefined;
|
|
746
742
|
}
|
|
747
743
|
} else if ('text' in part && part.text != null) {
|
|
748
744
|
const thoughtSignatureMetadata = part.thoughtSignature
|