@google/genai 2.1.0 → 2.3.0

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/dist/web/web.d.ts CHANGED
@@ -700,7 +700,7 @@ declare interface BaseCreateAgentInteractionParams {
700
700
  * Body param: Enforces that the generated response is a JSON object that complies
701
701
  * with the JSON schema specified in this field.
702
702
  */
703
- response_format?: Array<AudioResponseFormat | TextResponseFormat | ImageResponseFormat | VideoResponseFormat | unknown> | AudioResponseFormat | TextResponseFormat | ImageResponseFormat | VideoResponseFormat | unknown;
703
+ response_format?: Array<AudioResponseFormat | TextResponseFormat | ImageResponseFormat | unknown> | AudioResponseFormat | TextResponseFormat | ImageResponseFormat | unknown;
704
704
  /**
705
705
  * Body param: The mime type of the response. This is required if response_format
706
706
  * is set.
@@ -767,7 +767,7 @@ declare interface BaseCreateModelInteractionParams {
767
767
  * Body param: Enforces that the generated response is a JSON object that complies
768
768
  * with the JSON schema specified in this field.
769
769
  */
770
- response_format?: Array<AudioResponseFormat | TextResponseFormat | ImageResponseFormat | VideoResponseFormat | unknown> | AudioResponseFormat | TextResponseFormat | ImageResponseFormat | VideoResponseFormat | unknown;
770
+ response_format?: Array<AudioResponseFormat | TextResponseFormat | ImageResponseFormat | unknown> | AudioResponseFormat | TextResponseFormat | ImageResponseFormat | unknown;
771
771
  /**
772
772
  * Body param: The mime type of the response. This is required if response_format
773
773
  * is set.
@@ -6285,7 +6285,7 @@ declare interface Interaction {
6285
6285
  * Enforces that the generated response is a JSON object that complies with the
6286
6286
  * JSON schema specified in this field.
6287
6287
  */
6288
- response_format?: Array<AudioResponseFormat | TextResponseFormat | ImageResponseFormat | VideoResponseFormat | unknown> | AudioResponseFormat | TextResponseFormat | ImageResponseFormat | VideoResponseFormat | unknown;
6288
+ response_format?: Array<AudioResponseFormat | TextResponseFormat | ImageResponseFormat | unknown> | AudioResponseFormat | TextResponseFormat | ImageResponseFormat | unknown;
6289
6289
  /**
6290
6290
  * The mime type of the response. This is required if response_format is set.
6291
6291
  */
@@ -6319,6 +6319,30 @@ declare interface Interaction {
6319
6319
  * completes.
6320
6320
  */
6321
6321
  webhook_config?: WebhookConfig_2;
6322
+ /**
6323
+ * Concatenated text from the last model output in response to the current request.
6324
+ *
6325
+ * Note: this is added by the SDK.
6326
+ */
6327
+ output_text?: string;
6328
+ /**
6329
+ * The last image generated by the model in response to the current request.
6330
+ *
6331
+ * Note: this is added by the SDK.
6332
+ */
6333
+ output_image?: ImageContent;
6334
+ /**
6335
+ * The last audio generated by the model in response to the current request.
6336
+ *
6337
+ * Note: this is added by the SDK.
6338
+ */
6339
+ output_audio?: AudioContent;
6340
+ /**
6341
+ * The last video generated by the model in response to the current request.
6342
+ *
6343
+ * Note: this is added by the SDK.
6344
+ */
6345
+ output_video?: VideoContent;
6322
6346
  }
6323
6347
 
6324
6348
  declare interface InteractionCancelParams {
@@ -6413,7 +6437,7 @@ export declare class Interactions extends BaseInteractions {
6413
6437
  }
6414
6438
 
6415
6439
  export declare namespace Interactions {
6416
- export { type AllowedTools as AllowedTools, type Annotation as Annotation, type AudioContent as AudioContent, type AudioResponseFormat as AudioResponseFormat, type CodeExecutionCallArguments as CodeExecutionCallArguments, type CodeExecutionCallStep as CodeExecutionCallStep, type CodeExecutionResultStep as CodeExecutionResultStep, type Content_2 as Content, type DeepResearchAgentConfig as DeepResearchAgentConfig, type DocumentContent as DocumentContent, type DynamicAgentConfig as DynamicAgentConfig, type ErrorEvent_2 as ErrorEvent, type FileCitation as FileCitation, type FileSearchCallStep as FileSearchCallStep, type FileSearchResultStep as FileSearchResultStep, type Function_2 as Function, type FunctionCallStep as FunctionCallStep, type FunctionResultStep as FunctionResultStep, type GenerationConfig_2 as GenerationConfig, type GoogleMapsCallArguments as GoogleMapsCallArguments, type GoogleMapsCallStep as GoogleMapsCallStep, type GoogleMapsResult as GoogleMapsResult, type GoogleMapsResultStep as GoogleMapsResultStep, type GoogleSearchCallArguments as GoogleSearchCallArguments, type GoogleSearchCallStep as GoogleSearchCallStep, type GoogleSearchResult as GoogleSearchResult, type GoogleSearchResultStep as GoogleSearchResultStep, type ImageConfig_2 as ImageConfig, type ImageContent as ImageContent, type ImageResponseFormat as ImageResponseFormat, type Interaction as Interaction, type InteractionCompletedEvent as InteractionCompletedEvent, type InteractionCreatedEvent as InteractionCreatedEvent, type InteractionSSEEvent as InteractionSSEEvent, type InteractionStatusUpdate as InteractionStatusUpdate, type MCPServerToolCallStep as MCPServerToolCallStep, type MCPServerToolResultStep as MCPServerToolResultStep, type Model_2 as Model, type ModelOutputStep as ModelOutputStep, type PlaceCitation as PlaceCitation, type SpeechConfig_2 as SpeechConfig, type Step as Step, type StepDelta as StepDelta, type StepStart as StepStart, type StepStop as StepStop, type TextContent as TextContent, type TextResponseFormat as TextResponseFormat, type ThinkingLevel_2 as ThinkingLevel, type ThoughtStep as ThoughtStep, type Tool_2 as Tool, type ToolChoiceConfig as ToolChoiceConfig, type ToolChoiceType as ToolChoiceType, type URLCitation as URLCitation, type URLContextCallArguments as URLContextCallArguments, type URLContextCallStep as URLContextCallStep, type URLContextResult as URLContextResult, type URLContextResultStep as URLContextResultStep, type Usage as Usage, type UserInputStep as UserInputStep, type VideoContent as VideoContent, type VideoResponseFormat as VideoResponseFormat, type WebhookConfig_2 as WebhookConfig, type InteractionDeleteResponse as InteractionDeleteResponse, type InteractionCreateParams as InteractionCreateParams, type CreateModelInteractionParamsNonStreaming as CreateModelInteractionParamsNonStreaming, type CreateModelInteractionParamsStreaming as CreateModelInteractionParamsStreaming, type CreateAgentInteractionParamsNonStreaming as CreateAgentInteractionParamsNonStreaming, type CreateAgentInteractionParamsStreaming as CreateAgentInteractionParamsStreaming, type InteractionDeleteParams as InteractionDeleteParams, type InteractionCancelParams as InteractionCancelParams, type InteractionGetParams as InteractionGetParams, type InteractionGetParamsNonStreaming as InteractionGetParamsNonStreaming, type InteractionGetParamsStreaming as InteractionGetParamsStreaming, };
6440
+ export { type AllowedTools as AllowedTools, type Annotation as Annotation, type AudioContent as AudioContent, type AudioResponseFormat as AudioResponseFormat, type CodeExecutionCallArguments as CodeExecutionCallArguments, type CodeExecutionCallStep as CodeExecutionCallStep, type CodeExecutionResultStep as CodeExecutionResultStep, type Content_2 as Content, type DeepResearchAgentConfig as DeepResearchAgentConfig, type DocumentContent as DocumentContent, type DynamicAgentConfig as DynamicAgentConfig, type ErrorEvent_2 as ErrorEvent, type FileCitation as FileCitation, type FileSearchCallStep as FileSearchCallStep, type FileSearchResultStep as FileSearchResultStep, type Function_2 as Function, type FunctionCallStep as FunctionCallStep, type FunctionResultStep as FunctionResultStep, type GenerationConfig_2 as GenerationConfig, type GoogleMapsCallArguments as GoogleMapsCallArguments, type GoogleMapsCallStep as GoogleMapsCallStep, type GoogleMapsResult as GoogleMapsResult, type GoogleMapsResultStep as GoogleMapsResultStep, type GoogleSearchCallArguments as GoogleSearchCallArguments, type GoogleSearchCallStep as GoogleSearchCallStep, type GoogleSearchResult as GoogleSearchResult, type GoogleSearchResultStep as GoogleSearchResultStep, type ImageConfig_2 as ImageConfig, type ImageContent as ImageContent, type ImageResponseFormat as ImageResponseFormat, type Interaction as Interaction, type InteractionCompletedEvent as InteractionCompletedEvent, type InteractionCreatedEvent as InteractionCreatedEvent, type InteractionSSEEvent as InteractionSSEEvent, type InteractionStatusUpdate as InteractionStatusUpdate, type MCPServerToolCallStep as MCPServerToolCallStep, type MCPServerToolResultStep as MCPServerToolResultStep, type Model_2 as Model, type ModelOutputStep as ModelOutputStep, type PlaceCitation as PlaceCitation, type SpeechConfig_2 as SpeechConfig, type Step as Step, type StepDelta as StepDelta, type StepStart as StepStart, type StepStop as StepStop, type TextContent as TextContent, type TextResponseFormat as TextResponseFormat, type ThinkingLevel_2 as ThinkingLevel, type ThoughtStep as ThoughtStep, type Tool_2 as Tool, type ToolChoiceConfig as ToolChoiceConfig, type ToolChoiceType as ToolChoiceType, type URLCitation as URLCitation, type URLContextCallArguments as URLContextCallArguments, type URLContextCallStep as URLContextCallStep, type URLContextResult as URLContextResult, type URLContextResultStep as URLContextResultStep, type Usage as Usage, type UserInputStep as UserInputStep, type VideoContent as VideoContent, type WebhookConfig_2 as WebhookConfig, type InteractionDeleteResponse as InteractionDeleteResponse, type InteractionCreateParams as InteractionCreateParams, type CreateModelInteractionParamsNonStreaming as CreateModelInteractionParamsNonStreaming, type CreateModelInteractionParamsStreaming as CreateModelInteractionParamsStreaming, type CreateAgentInteractionParamsNonStreaming as CreateAgentInteractionParamsNonStreaming, type CreateAgentInteractionParamsStreaming as CreateAgentInteractionParamsStreaming, type InteractionDeleteParams as InteractionDeleteParams, type InteractionCancelParams as InteractionCancelParams, type InteractionGetParams as InteractionGetParams, type InteractionGetParamsNonStreaming as InteractionGetParamsNonStreaming, type InteractionGetParamsStreaming as InteractionGetParamsStreaming, };
6417
6441
  }
6418
6442
 
6419
6443
  declare namespace InteractionsAPI {
@@ -6480,7 +6504,6 @@ declare namespace InteractionsAPI {
6480
6504
  Usage,
6481
6505
  UserInputStep,
6482
6506
  VideoContent,
6483
- VideoResponseFormat,
6484
6507
  WebhookConfig_2 as WebhookConfig,
6485
6508
  InteractionDeleteResponse,
6486
6509
  InteractionCreateParams,
@@ -7141,6 +7164,8 @@ export declare interface LiveConnectConfig {
7141
7164
  response.
7142
7165
  */
7143
7166
  safetySettings?: SafetySetting[];
7167
+ /** Config for stream translation. */
7168
+ streamTranslationConfig?: StreamTranslationConfig;
7144
7169
  }
7145
7170
 
7146
7171
  /** Config for LiveConnectConstraints for Auth Token creation. */
@@ -9967,7 +9992,7 @@ export declare enum StartSensitivity {
9967
9992
  declare type Step = UserInputStep | ModelOutputStep | ThoughtStep | FunctionCallStep | CodeExecutionCallStep | URLContextCallStep | MCPServerToolCallStep | GoogleSearchCallStep | FileSearchCallStep | GoogleMapsCallStep | FunctionResultStep | CodeExecutionResultStep | URLContextResultStep | GoogleSearchResultStep | MCPServerToolResultStep | FileSearchResultStep | GoogleMapsResultStep;
9968
9993
 
9969
9994
  declare interface StepDelta {
9970
- delta: StepDelta.Text | StepDelta.Image | StepDelta.Audio | StepDelta.Document | StepDelta.Video | StepDelta.ThoughtSummary | StepDelta.ThoughtSignature | StepDelta.TextAnnotationDelta | StepDelta.ArgumentsDelta | StepDelta.CodeExecutionCall | StepDelta.URLContextCall | StepDelta.GoogleSearchCall | StepDelta.MCPServerToolCall | StepDelta.FileSearchCall | StepDelta.GoogleMapsCall | StepDelta.CodeExecutionResult | StepDelta.URLContextResult | StepDelta.GoogleSearchResult | StepDelta.MCPServerToolResult | StepDelta.FileSearchResult | StepDelta.GoogleMapsResult;
9995
+ delta: StepDelta.Text | StepDelta.Image | StepDelta.Audio | StepDelta.Document | StepDelta.Video | StepDelta.ThoughtSummary | StepDelta.ThoughtSignature | StepDelta.TextAnnotationDelta | StepDelta.ArgumentsDelta | StepDelta.CodeExecutionCall | StepDelta.URLContextCall | StepDelta.GoogleSearchCall | StepDelta.MCPServerToolCall | StepDelta.FileSearchCall | StepDelta.GoogleMapsCall | StepDelta.CodeExecutionResult | StepDelta.URLContextResult | StepDelta.GoogleSearchResult | StepDelta.MCPServerToolResult | StepDelta.FileSearchResult | StepDelta.GoogleMapsResult | StepDelta.FunctionResult;
9971
9996
  event_type: 'step.delta';
9972
9997
  index: number;
9973
9998
  /**
@@ -10048,6 +10073,7 @@ declare namespace StepDelta {
10048
10073
  }
10049
10074
  interface ArgumentsDelta {
10050
10075
  type: 'arguments_delta';
10076
+ arguments?: string;
10051
10077
  }
10052
10078
  interface CodeExecutionCall {
10053
10079
  /**
@@ -10168,6 +10194,16 @@ declare namespace StepDelta {
10168
10194
  */
10169
10195
  signature?: string;
10170
10196
  }
10197
+ interface FunctionResult {
10198
+ /**
10199
+ * Required. ID to match the ID from the function call block.
10200
+ */
10201
+ call_id: string;
10202
+ result: unknown | Array<InteractionsAPI.TextContent | InteractionsAPI.ImageContent> | string;
10203
+ type: 'function_result';
10204
+ is_error?: boolean;
10205
+ name?: string;
10206
+ }
10171
10207
  }
10172
10208
 
10173
10209
  declare interface StepStart {
@@ -10231,6 +10267,17 @@ export declare interface StreamableHttpTransport {
10231
10267
  url?: string;
10232
10268
  }
10233
10269
 
10270
+ /** Config for stream translation. */
10271
+ export declare interface StreamTranslationConfig {
10272
+ /** If true, the model will generate audio when the target language is
10273
+ spoken, essentially it will parrot the input. If false, we will not produce
10274
+ audio for the target language. */
10275
+ echoTargetLanguage?: boolean;
10276
+ /** The target language for translation. Supported values are BCP-47
10277
+ language codes (e.g. "en", "es", "fr"). */
10278
+ targetLanguageCode?: string;
10279
+ }
10280
+
10234
10281
  /** User provided string values assigned to a single metadata key. This data type is not supported in Vertex AI. */
10235
10282
  export declare interface StringList {
10236
10283
  /** The string values of the metadata to store. */
@@ -11828,6 +11875,7 @@ declare namespace types {
11828
11875
  LiveClientRealtimeInput,
11829
11876
  LiveClientToolResponse,
11830
11877
  LiveClientMessage,
11878
+ StreamTranslationConfig,
11831
11879
  LiveConnectConfig,
11832
11880
  LiveConnectParameters,
11833
11881
  CreateChatParameters,
@@ -12685,30 +12733,6 @@ export declare interface VideoMetadata {
12685
12733
  startOffset?: string;
12686
12734
  }
12687
12735
 
12688
- /**
12689
- * Configuration for video output format.
12690
- */
12691
- declare interface VideoResponseFormat {
12692
- type: 'video';
12693
- /**
12694
- * The aspect ratio for the video output.
12695
- */
12696
- aspectRatio?: '16:9' | '9:16';
12697
- /**
12698
- * The delivery mode for the video output.
12699
- */
12700
- delivery?: 'inline' | 'uri';
12701
- /**
12702
- * The duration for the video output.
12703
- */
12704
- duration?: string;
12705
- /**
12706
- * The GCS URI to store the video output. Required for Vertex if delivery mode is
12707
- * URI.
12708
- */
12709
- gcsUri?: string;
12710
- }
12711
-
12712
12736
  /** Voice activity signal. */
12713
12737
  export declare interface VoiceActivity {
12714
12738
  /** The type of the voice activity signal. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/genai",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/node/index.mjs",