@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "3.0.95",
3
+ "version": "3.0.96",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -375,7 +375,7 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
375
375
 
376
376
  const usageMetadata = response.usageMetadata;
377
377
 
378
- // Associates a code execution result with its preceding call.
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
- // Assumes a result directly follows its corresponding call part.
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 a code execution result with its preceding call.
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
- // Assumes a result directly follows its corresponding call part.
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