@langchain/google 0.2.12 → 0.2.13
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 +16 -0
- package/dist/chat_models/api_types/generate_content.d.cts +0 -2
- package/dist/chat_models/api_types/generate_content.d.ts +0 -2
- package/dist/chat_models/api_types/interactions.d.cts +1423 -0
- package/dist/chat_models/api_types/interactions.d.ts +1423 -0
- package/dist/chat_models/base.cjs +12 -11
- package/dist/chat_models/base.cjs.map +1 -1
- package/dist/chat_models/base.d.cts +3 -5
- package/dist/chat_models/base.d.ts +3 -5
- package/dist/chat_models/base.js +12 -11
- package/dist/chat_models/base.js.map +1 -1
- package/dist/chat_models/handlers/base.cjs +1 -2
- package/dist/chat_models/handlers/base.d.cts +0 -2
- package/dist/chat_models/handlers/base.d.ts +0 -2
- package/dist/chat_models/handlers/base.js +1 -2
- package/dist/chat_models/handlers/generate_content.cjs +5 -6
- package/dist/chat_models/handlers/generate_content.d.cts +0 -2
- package/dist/chat_models/handlers/generate_content.d.ts +0 -2
- package/dist/chat_models/handlers/generate_content.js +5 -6
- package/dist/chat_models/handlers/index.cjs +2 -0
- package/dist/chat_models/handlers/index.d.cts +2 -1
- package/dist/chat_models/handlers/index.d.ts +2 -1
- package/dist/chat_models/handlers/index.js +2 -1
- package/dist/chat_models/handlers/interactions.cjs +303 -0
- package/dist/chat_models/handlers/interactions.cjs.map +1 -0
- package/dist/chat_models/handlers/interactions.d.cts +33 -0
- package/dist/chat_models/handlers/interactions.d.ts +33 -0
- package/dist/chat_models/handlers/interactions.js +303 -0
- package/dist/chat_models/handlers/interactions.js.map +1 -0
- package/dist/chat_models/index.cjs +5 -4
- package/dist/chat_models/index.cjs.map +1 -1
- package/dist/chat_models/index.d.cts +4 -5
- package/dist/chat_models/index.d.ts +4 -5
- package/dist/chat_models/index.js +5 -5
- package/dist/chat_models/index.js.map +1 -1
- package/dist/chat_models/node.cjs +3 -4
- package/dist/chat_models/node.d.cts +1 -3
- package/dist/chat_models/node.d.ts +1 -3
- package/dist/chat_models/node.js +3 -4
- package/dist/chat_models/profiles.cjs +1 -2
- package/dist/chat_models/profiles.js +1 -2
- package/dist/chat_models/types.cjs +1 -2
- package/dist/chat_models/types.cjs.map +1 -1
- package/dist/chat_models/types.d.cts +524 -23
- package/dist/chat_models/types.d.ts +524 -23
- package/dist/chat_models/types.js +1 -2
- package/dist/chat_models/types.js.map +1 -1
- package/dist/clients/index.cjs +3 -4
- package/dist/clients/index.d.cts +0 -2
- package/dist/clients/index.d.ts +0 -2
- package/dist/clients/index.js +3 -4
- package/dist/clients/node.cjs +4 -5
- package/dist/clients/node.d.cts +0 -2
- package/dist/clients/node.d.ts +0 -2
- package/dist/clients/node.js +4 -5
- package/dist/const.cjs +1 -2
- package/dist/const.js +1 -2
- package/dist/converters/generate_content/messages.cjs +1 -2
- package/dist/converters/generate_content/messages.js +1 -2
- package/dist/converters/generate_content/params.cjs +1 -2
- package/dist/converters/generate_content/params.js +1 -2
- package/dist/converters/generate_content/stream_events.cjs +1 -2
- package/dist/converters/generate_content/stream_events.js +1 -2
- package/dist/converters/generate_content/tools.cjs +1 -2
- package/dist/converters/generate_content/tools.js +1 -2
- package/dist/converters/interactions/messages.cjs +766 -0
- package/dist/converters/interactions/messages.cjs.map +1 -0
- package/dist/converters/interactions/messages.js +759 -0
- package/dist/converters/interactions/messages.js.map +1 -0
- package/dist/converters/interactions/params.cjs +244 -0
- package/dist/converters/interactions/params.cjs.map +1 -0
- package/dist/converters/interactions/params.js +237 -0
- package/dist/converters/interactions/params.js.map +1 -0
- package/dist/converters/interactions/stream_events.cjs +769 -0
- package/dist/converters/interactions/stream_events.cjs.map +1 -0
- package/dist/converters/interactions/stream_events.js +768 -0
- package/dist/converters/interactions/stream_events.js.map +1 -0
- package/dist/converters/interactions/tools.cjs +229 -0
- package/dist/converters/interactions/tools.cjs.map +1 -0
- package/dist/converters/interactions/tools.js +228 -0
- package/dist/converters/interactions/tools.js.map +1 -0
- package/dist/converters/shared/params.cjs +1 -2
- package/dist/converters/shared/params.js +1 -2
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/node.cjs +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/utils/errors.cjs +1 -2
- package/dist/utils/errors.js +1 -2
- package/dist/utils/gcp-auth.cjs +3 -4
- package/dist/utils/gcp-auth.d.cts +0 -2
- package/dist/utils/gcp-auth.d.ts +0 -2
- package/dist/utils/gcp-auth.js +3 -4
- package/dist/utils/handler.cjs +1 -2
- package/dist/utils/handler.d.cts +0 -2
- package/dist/utils/handler.d.ts +0 -2
- package/dist/utils/handler.js +1 -2
- package/dist/utils/metadata.cjs +1 -2
- package/dist/utils/metadata.js +1 -2
- package/dist/utils/misc.cjs +1 -2
- package/dist/utils/misc.d.cts +0 -2
- package/dist/utils/misc.d.ts +0 -2
- package/dist/utils/misc.js +1 -2
- package/dist/utils/stream.cjs +1 -2
- package/dist/utils/stream.js +1 -2
- package/package.json +11 -9
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ApiClient } from "../clients/index.js";
|
|
2
2
|
import { GenContent } from "./api_types/generate_content.js";
|
|
3
|
+
import { Interactions } from "./api_types/interactions.js";
|
|
3
4
|
import { LowercaseLiteral, Prettify } from "../utils/misc.js";
|
|
4
5
|
import { GoogleChatApiHandler } from "./handlers/base.js";
|
|
5
6
|
import { BaseChatModelCallOptions, BaseChatModelParams, BindToolsInput } from "@langchain/core/language_models/chat_models";
|
|
6
7
|
import { InteropZodType } from "@langchain/core/utils/types";
|
|
7
8
|
import { SerializableSchema } from "@langchain/core/utils/standard_schema";
|
|
8
9
|
import { AsyncCaller } from "@langchain/core/utils/async_caller";
|
|
9
|
-
//#region src/chat_models/types.d.ts
|
|
10
10
|
export interface BaseChatGoogleFields {
|
|
11
11
|
/**
|
|
12
12
|
* The temperature is used for sampling during response generation, which
|
|
@@ -120,8 +120,6 @@ export interface BaseChatGoogleFields {
|
|
|
120
120
|
* string value in the Gemini API.
|
|
121
121
|
*/
|
|
122
122
|
mediaResolution?: Gemini.Shared.MediaResolution;
|
|
123
|
-
}
|
|
124
|
-
export interface GenerateContentSpecificFields {
|
|
125
123
|
/**
|
|
126
124
|
* The schema that the generated response should match.
|
|
127
125
|
* Can be a Zod schema or a JSON Schema object.
|
|
@@ -139,26 +137,10 @@ export interface GenerateContentSpecificFields {
|
|
|
139
137
|
* An empty list is equivalent to requesting only text.
|
|
140
138
|
*/
|
|
141
139
|
responseModalities?: Prettify<GenContent.GenerativeLanguageModality>[];
|
|
142
|
-
/**
|
|
143
|
-
* If true, returns the log probabilities of the tokens that were chosen by
|
|
144
|
-
* the model at each step. By default, this parameter is set to false.
|
|
145
|
-
*/
|
|
146
|
-
responseLogprobs?: boolean;
|
|
147
|
-
/**
|
|
148
|
-
* Returns the log probabilities of the top candidate tokens at each generation
|
|
149
|
-
* step. The model's chosen token might not be the same as the top candidate
|
|
150
|
-
* token at each step. Specify the number of candidates to return by using an
|
|
151
|
-
* integer value in the range of 1-20.
|
|
152
|
-
*/
|
|
153
|
-
logprobs?: number;
|
|
154
140
|
/**
|
|
155
141
|
* Configuration for the model's thinking process
|
|
156
142
|
*/
|
|
157
143
|
thinkingConfig?: Prettify<GenContent.ThinkingConfig>;
|
|
158
|
-
/**
|
|
159
|
-
* If true, enables enhanced civic answers feature.
|
|
160
|
-
*/
|
|
161
|
-
enableEnhancedCivicAnswers?: boolean;
|
|
162
144
|
/**
|
|
163
145
|
* Speech generation configuration.
|
|
164
146
|
* You can use either Google's definition of the speech configuration,
|
|
@@ -178,8 +160,60 @@ export interface GenerateContentSpecificFields {
|
|
|
178
160
|
*/
|
|
179
161
|
serviceTier?: GenContent.ServiceTier;
|
|
180
162
|
}
|
|
163
|
+
export interface GenerateContentSpecificFields {
|
|
164
|
+
/**
|
|
165
|
+
* If true, returns the log probabilities of the tokens that were chosen by
|
|
166
|
+
* the model at each step. By default, this parameter is set to false.
|
|
167
|
+
*/
|
|
168
|
+
responseLogprobs?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Returns the log probabilities of the top candidate tokens at each generation
|
|
171
|
+
* step. The model's chosen token might not be the same as the top candidate
|
|
172
|
+
* token at each step. Specify the number of candidates to return by using an
|
|
173
|
+
* integer value in the range of 1-20.
|
|
174
|
+
*/
|
|
175
|
+
logprobs?: number;
|
|
176
|
+
/**
|
|
177
|
+
* If true, enables enhanced civic answers feature.
|
|
178
|
+
*/
|
|
179
|
+
enableEnhancedCivicAnswers?: boolean;
|
|
180
|
+
}
|
|
181
|
+
export interface InteractionsSpecificFields {
|
|
182
|
+
/**
|
|
183
|
+
* Native Interactions API `response_format` configuration (JSON Schema or media response format).
|
|
184
|
+
* Note: `responseSchema`, `responseModalities`, `responseMimeType`, and `imageConfig` are also
|
|
185
|
+
* automatically translated into `response_format` when using the Interactions API.
|
|
186
|
+
*/
|
|
187
|
+
responseFormat?: Gemini.Interactions.CreateInteractionParameters["response_format"];
|
|
188
|
+
/**
|
|
189
|
+
* The ID of a previous interaction to continue a stateful server-side conversation.
|
|
190
|
+
*/
|
|
191
|
+
previousInteractionId?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Whether to store the interaction on the server.
|
|
194
|
+
*/
|
|
195
|
+
store?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Whether to execute the interaction in the background (primarily for agents).
|
|
198
|
+
*/
|
|
199
|
+
background?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* The name of the agent to use for the interaction (mutually exclusive with `model` in the raw API,
|
|
202
|
+
* or used when invoking an agent endpoint).
|
|
203
|
+
*/
|
|
204
|
+
agent?: string;
|
|
205
|
+
/**
|
|
206
|
+
* Configuration parameters for the specified agent.
|
|
207
|
+
*/
|
|
208
|
+
agentConfig?: Gemini.Interactions.AgentConfig;
|
|
209
|
+
/**
|
|
210
|
+
* Optional webhook configuration for receiving asynchronous interaction events.
|
|
211
|
+
*/
|
|
212
|
+
webhookConfig?: Gemini.Interactions.WebhookConfig;
|
|
213
|
+
}
|
|
181
214
|
export interface GenerateContentFields extends BaseChatGoogleFields, GenerateContentSpecificFields {}
|
|
182
|
-
export interface
|
|
215
|
+
export interface InteractionsFields extends BaseChatGoogleFields, InteractionsSpecificFields {}
|
|
216
|
+
export interface ChatGoogleFields extends BaseChatGoogleFields, Partial<GenerateContentSpecificFields>, Partial<InteractionsSpecificFields> {}
|
|
183
217
|
export type GooglePlatformType = "gai" | "gcp";
|
|
184
218
|
export interface BaseChatGoogleParams extends BaseChatModelParams, ChatGoogleFields {
|
|
185
219
|
model: string;
|
|
@@ -211,11 +245,13 @@ export interface GoogleChatApiHandlerParams extends BaseChatModelParams, BaseCha
|
|
|
211
245
|
customHeaders?: Record<string, string>;
|
|
212
246
|
}
|
|
213
247
|
export interface GenerateContentApiHandlerParams extends GoogleChatApiHandlerParams, GenerateContentSpecificFields {}
|
|
248
|
+
export interface InteractionsApiHandlerParams extends GoogleChatApiHandlerParams, InteractionsSpecificFields {}
|
|
214
249
|
export type GoogleChatApiHandlerFactory = (params: GoogleChatApiHandlerParams) => GoogleChatApiHandler;
|
|
215
|
-
export type GoogleChatApiHandlerConfig = "generateContent" | GoogleChatApiHandlerFactory;
|
|
250
|
+
export type GoogleChatApiHandlerConfig = "generateContent" | "interactions" | GoogleChatApiHandlerFactory;
|
|
216
251
|
export type GenerateContentInvocationParams = Partial<Omit<GenContent.GenerateContentRequest, "contents">> & {
|
|
217
252
|
serviceTier?: GenContent.ServiceTier;
|
|
218
253
|
};
|
|
254
|
+
export type InteractionsInvocationParams = Partial<Omit<Gemini.Interactions.CreateInteractionParameters, "input">>;
|
|
219
255
|
declare module "./api_types/generate_content.js" {
|
|
220
256
|
namespace GenContent {
|
|
221
257
|
namespace Part {
|
|
@@ -327,6 +363,7 @@ export declare namespace Gemini {
|
|
|
327
363
|
type Speaker = GenContent.SpeakerVoiceConfig.Speaker;
|
|
328
364
|
}
|
|
329
365
|
type ServiceTier = GenContent.ServiceTier;
|
|
366
|
+
type ImageConfig = GenContent.ImageConfig;
|
|
330
367
|
type Role = GenContent.Role;
|
|
331
368
|
type GroundingSupport = GenContent.GroundingSupport;
|
|
332
369
|
type GroundingMetadata = GenContent.GroundingMetadata;
|
|
@@ -392,6 +429,7 @@ export declare namespace Gemini {
|
|
|
392
429
|
type Speaker = GenContent.SpeakerVoiceConfig.Speaker;
|
|
393
430
|
}
|
|
394
431
|
type ServiceTier = GenContent.ServiceTier;
|
|
432
|
+
type ImageConfig = GenContent.ImageConfig;
|
|
395
433
|
type Role = GenContent.Role;
|
|
396
434
|
type GroundingSupport = GenContent.GroundingSupport;
|
|
397
435
|
type GroundingMetadata = GenContent.GroundingMetadata;
|
|
@@ -432,6 +470,470 @@ export declare namespace Gemini {
|
|
|
432
470
|
type WebSearch = GenContent.Tools.WebSearch;
|
|
433
471
|
type ImageSearch = GenContent.Tools.ImageSearch;
|
|
434
472
|
}
|
|
473
|
+
namespace Interactions {
|
|
474
|
+
type StaticMediaProcessing = Omit<Interactions.StaticMediaProcessing, "type"> & {
|
|
475
|
+
type: "static";
|
|
476
|
+
};
|
|
477
|
+
type MediaProcessing = StaticMediaProcessing;
|
|
478
|
+
type UrlCitation = Omit<Interactions.UrlCitation, "type"> & {
|
|
479
|
+
type: "url_citation";
|
|
480
|
+
};
|
|
481
|
+
type FileCitation = Omit<Interactions.FileCitation, "type"> & {
|
|
482
|
+
type: "file_citation";
|
|
483
|
+
};
|
|
484
|
+
type PlaceCitation = Omit<Interactions.PlaceCitation, "type"> & {
|
|
485
|
+
type: "place_citation";
|
|
486
|
+
};
|
|
487
|
+
type SpeechAnnotation = Omit<Interactions.SpeechAnnotation, "type"> & {
|
|
488
|
+
type: "speech_metadata";
|
|
489
|
+
};
|
|
490
|
+
type WordInfo = Omit<Interactions.WordInfo, "type"> & {
|
|
491
|
+
type: "word_info";
|
|
492
|
+
};
|
|
493
|
+
type Annotation = UrlCitation | FileCitation | PlaceCitation | SpeechAnnotation | WordInfo;
|
|
494
|
+
type TextContent = Omit<Interactions.TextContent, "type" | "annotations"> & {
|
|
495
|
+
type: "text";
|
|
496
|
+
annotations?: Array<Annotation>;
|
|
497
|
+
};
|
|
498
|
+
type ImageContent = Omit<Interactions.ImageContent, "type"> & {
|
|
499
|
+
type: "image";
|
|
500
|
+
};
|
|
501
|
+
type AudioContent = Omit<Interactions.AudioContent, "type"> & {
|
|
502
|
+
type: "audio";
|
|
503
|
+
};
|
|
504
|
+
type DocumentContent = Omit<Interactions.DocumentContent, "type"> & {
|
|
505
|
+
type: "document";
|
|
506
|
+
};
|
|
507
|
+
type VideoContent = Omit<Interactions.VideoContent, "type" | "processing"> & {
|
|
508
|
+
type: "video";
|
|
509
|
+
processing?: MediaProcessing | "static" | "agentic" | (string & {});
|
|
510
|
+
};
|
|
511
|
+
type Content = TextContent | ImageContent | AudioContent | DocumentContent | VideoContent;
|
|
512
|
+
type UserInputStep = Omit<Interactions.UserInputStep, "type" | "content"> & {
|
|
513
|
+
type: "user_input";
|
|
514
|
+
content?: Array<Content> | string;
|
|
515
|
+
};
|
|
516
|
+
type ModelOutputStep = Omit<Interactions.ModelOutputStep, "type" | "content"> & {
|
|
517
|
+
type: "model_output";
|
|
518
|
+
content?: Array<Content> | string;
|
|
519
|
+
};
|
|
520
|
+
type ThoughtStep = Omit<Interactions.ThoughtStep, "type" | "summary"> & {
|
|
521
|
+
type: "thought";
|
|
522
|
+
summary?: Array<Content>;
|
|
523
|
+
};
|
|
524
|
+
type FunctionCallStep = Omit<Interactions.FunctionCallStep, "type"> & {
|
|
525
|
+
type: "function_call";
|
|
526
|
+
};
|
|
527
|
+
type FunctionResultStep = Omit<Interactions.FunctionResultStep, "type" | "result"> & {
|
|
528
|
+
type: "function_result";
|
|
529
|
+
result: Array<Content> | string | Record<string, unknown>;
|
|
530
|
+
};
|
|
531
|
+
type CodeExecutionCallStep = Omit<Interactions.CodeExecutionCallStep, "type"> & {
|
|
532
|
+
type: "code_execution_call";
|
|
533
|
+
};
|
|
534
|
+
type CodeExecutionResultStep = Omit<Interactions.CodeExecutionResultStep, "type"> & {
|
|
535
|
+
type: "code_execution_result";
|
|
536
|
+
};
|
|
537
|
+
type GoogleSearchCallStep = Omit<Interactions.GoogleSearchCallStep, "type"> & {
|
|
538
|
+
type: "google_search_call";
|
|
539
|
+
};
|
|
540
|
+
type GoogleSearchResultStep = Omit<Interactions.GoogleSearchResultStep, "type"> & {
|
|
541
|
+
type: "google_search_result";
|
|
542
|
+
};
|
|
543
|
+
type UrlContextCallStep = Omit<Interactions.UrlContextCallStep, "type"> & {
|
|
544
|
+
type: "url_context_call";
|
|
545
|
+
};
|
|
546
|
+
type UrlContextResultStep = Omit<Interactions.UrlContextResultStep, "type"> & {
|
|
547
|
+
type: "url_context_result";
|
|
548
|
+
};
|
|
549
|
+
type FileSearchCallStep = Omit<Interactions.FileSearchCallStep, "type"> & {
|
|
550
|
+
type: "file_search_call";
|
|
551
|
+
};
|
|
552
|
+
type FileSearchResultStep = Omit<Interactions.FileSearchResultStep, "type"> & {
|
|
553
|
+
type: "file_search_result";
|
|
554
|
+
result?: Array<FileSearchResultItem>;
|
|
555
|
+
};
|
|
556
|
+
type GoogleMapsCallStep = Omit<Interactions.GoogleMapsCallStep, "type"> & {
|
|
557
|
+
type: "google_maps_call";
|
|
558
|
+
};
|
|
559
|
+
type GoogleMapsResultStep = Omit<Interactions.GoogleMapsResultStep, "type"> & {
|
|
560
|
+
type: "google_maps_result";
|
|
561
|
+
};
|
|
562
|
+
type McpServerToolCallStep = Omit<Interactions.McpServerToolCallStep, "type"> & {
|
|
563
|
+
type: "mcp_server_tool_call";
|
|
564
|
+
};
|
|
565
|
+
type McpServerToolResultStep = Omit<Interactions.McpServerToolResultStep, "type" | "result"> & {
|
|
566
|
+
type: "mcp_server_tool_result";
|
|
567
|
+
result: Array<Content> | string | Record<string, unknown>;
|
|
568
|
+
};
|
|
569
|
+
type ProcessingCallStep = Omit<Interactions.ProcessingCallStep, "type"> & {
|
|
570
|
+
type: "processing_call";
|
|
571
|
+
};
|
|
572
|
+
type ProcessingResultStep = Omit<Interactions.ProcessingResultStep, "type"> & {
|
|
573
|
+
type: "processing_result";
|
|
574
|
+
};
|
|
575
|
+
type RetrievalCallStep = Omit<Interactions.RetrievalCallStep, "type"> & {
|
|
576
|
+
type: "retrieval_call";
|
|
577
|
+
};
|
|
578
|
+
type RetrievalResultStep = Omit<Interactions.RetrievalResultStep, "type"> & {
|
|
579
|
+
type: "retrieval_result";
|
|
580
|
+
};
|
|
581
|
+
type Step = UserInputStep | ModelOutputStep | ThoughtStep | FunctionCallStep | FunctionResultStep | CodeExecutionCallStep | CodeExecutionResultStep | GoogleSearchCallStep | GoogleSearchResultStep | UrlContextCallStep | UrlContextResultStep | FileSearchCallStep | FileSearchResultStep | GoogleMapsCallStep | GoogleMapsResultStep | McpServerToolCallStep | McpServerToolResultStep | ProcessingCallStep | ProcessingResultStep | RetrievalCallStep | RetrievalResultStep;
|
|
582
|
+
type Function = Omit<Interactions.Tools.Function, "type"> & {
|
|
583
|
+
type: "function";
|
|
584
|
+
};
|
|
585
|
+
type GoogleSearch = Omit<Interactions.Tools.GoogleSearch, "type"> & {
|
|
586
|
+
type: "google_search";
|
|
587
|
+
time_range_filter?: {
|
|
588
|
+
start_time?: string;
|
|
589
|
+
end_time?: string;
|
|
590
|
+
};
|
|
591
|
+
};
|
|
592
|
+
type CodeExecution = Omit<Interactions.Tools.CodeExecution, "type"> & {
|
|
593
|
+
type: "code_execution";
|
|
594
|
+
};
|
|
595
|
+
type UrlContext = Omit<Interactions.Tools.UrlContext, "type"> & {
|
|
596
|
+
type: "url_context";
|
|
597
|
+
};
|
|
598
|
+
type ComputerUse = Omit<Interactions.Tools.ComputerUse, "type"> & {
|
|
599
|
+
type: "computer_use";
|
|
600
|
+
};
|
|
601
|
+
type FileSearch = Omit<Interactions.Tools.FileSearch, "type"> & {
|
|
602
|
+
type: "file_search";
|
|
603
|
+
};
|
|
604
|
+
type GoogleMaps = Omit<Interactions.Tools.GoogleMaps, "type"> & {
|
|
605
|
+
type: "google_maps";
|
|
606
|
+
};
|
|
607
|
+
type McpServer = Omit<Interactions.Tools.McpServer, "type"> & {
|
|
608
|
+
type: "mcp_server";
|
|
609
|
+
};
|
|
610
|
+
type Retrieval = Omit<Interactions.Tools.Retrieval, "type"> & {
|
|
611
|
+
type: "retrieval";
|
|
612
|
+
};
|
|
613
|
+
type Tool = Function | GoogleSearch | CodeExecution | UrlContext | ComputerUse | FileSearch | GoogleMaps | McpServer | Retrieval;
|
|
614
|
+
namespace Tools {
|
|
615
|
+
type AllowedTools = Interactions.Tools.AllowedTools;
|
|
616
|
+
type CodeExecution = Gemini.Interactions.CodeExecution;
|
|
617
|
+
type ComputerUse = Gemini.Interactions.ComputerUse;
|
|
618
|
+
type FileSearch = Gemini.Interactions.FileSearch;
|
|
619
|
+
type Function = Gemini.Interactions.Function;
|
|
620
|
+
type GoogleMaps = Gemini.Interactions.GoogleMaps;
|
|
621
|
+
type GoogleSearch = Gemini.Interactions.GoogleSearch;
|
|
622
|
+
type McpServer = Gemini.Interactions.McpServer;
|
|
623
|
+
type Retrieval = Gemini.Interactions.Retrieval;
|
|
624
|
+
type Tool = Gemini.Interactions.Tool;
|
|
625
|
+
type UrlContext = Gemini.Interactions.UrlContext;
|
|
626
|
+
type VertexAISearchConfig = Interactions.Tools.VertexAISearchConfig;
|
|
627
|
+
}
|
|
628
|
+
type TextResponseFormat = Omit<Interactions.TextResponseFormat, "type"> & {
|
|
629
|
+
type: "text";
|
|
630
|
+
};
|
|
631
|
+
type ImageResponseFormat = Omit<Interactions.ImageResponseFormat, "type"> & {
|
|
632
|
+
type: "image";
|
|
633
|
+
};
|
|
634
|
+
type AudioResponseFormat = Omit<Interactions.AudioResponseFormat, "type"> & {
|
|
635
|
+
type: "audio";
|
|
636
|
+
};
|
|
637
|
+
type VideoResponseFormat = Omit<Interactions.VideoResponseFormat, "type"> & {
|
|
638
|
+
type: "video";
|
|
639
|
+
mime_type?: string;
|
|
640
|
+
};
|
|
641
|
+
type ResponseFormat = TextResponseFormat | ImageResponseFormat | AudioResponseFormat | VideoResponseFormat;
|
|
642
|
+
type AntigravityAgentConfig = Omit<Interactions.AntigravityAgentConfig, "type"> & {
|
|
643
|
+
type: "antigravity";
|
|
644
|
+
};
|
|
645
|
+
type CodeMenderAgentConfig = Omit<Interactions.CodeMenderAgentConfig, "type"> & {
|
|
646
|
+
type: "code-mender";
|
|
647
|
+
};
|
|
648
|
+
type DeepResearchAgentConfig = Omit<Interactions.DeepResearchAgentConfig, "type"> & {
|
|
649
|
+
type: "deep-research";
|
|
650
|
+
};
|
|
651
|
+
type DynamicAgentConfig = Omit<Interactions.DynamicAgentConfig, "type"> & {
|
|
652
|
+
type: "dynamic";
|
|
653
|
+
};
|
|
654
|
+
type AgentConfig = AntigravityAgentConfig | CodeMenderAgentConfig | DeepResearchAgentConfig | DynamicAgentConfig;
|
|
655
|
+
type CreateInteractionParameters = Omit<Interactions.Interaction, "agent_config" | "created" | "environment_id" | "errors" | "generation_config" | "id" | "input" | "model" | "response_format" | "status" | "steps" | "tools" | "updated" | "usage"> & {
|
|
656
|
+
model?: Interactions.ModelOption;
|
|
657
|
+
agent?: Interactions.AgentOption;
|
|
658
|
+
agent_config?: AgentConfig;
|
|
659
|
+
generation_config?: GenerationConfig;
|
|
660
|
+
input: Array<Content> | Array<Step> | Content | Step | string;
|
|
661
|
+
response_format?: Record<string, unknown> | ResponseFormat | Array<ResponseFormat>;
|
|
662
|
+
tools?: Array<Tool>;
|
|
663
|
+
};
|
|
664
|
+
type Interaction = Omit<Interactions.Interaction, "agent_config" | "generation_config" | "input" | "model" | "response_format" | "steps" | "tools"> & {
|
|
665
|
+
model?: Interactions.ModelOption;
|
|
666
|
+
agent?: Interactions.AgentOption;
|
|
667
|
+
agent_config?: AgentConfig;
|
|
668
|
+
generation_config?: GenerationConfig;
|
|
669
|
+
input?: Array<Content> | Array<Step> | Content | Step | string;
|
|
670
|
+
response_format?: Record<string, unknown> | ResponseFormat | Array<ResponseFormat>;
|
|
671
|
+
role?: string;
|
|
672
|
+
steps?: Array<Step>;
|
|
673
|
+
outputs?: Array<Step | Content>;
|
|
674
|
+
tools?: Array<Tool>;
|
|
675
|
+
};
|
|
676
|
+
type AllowedTools = Interactions.Tools.AllowedTools;
|
|
677
|
+
type CodeExecutionCallStepArguments = Interactions.CodeExecutionCallStepArguments;
|
|
678
|
+
type Error = Interactions.Status;
|
|
679
|
+
type Status = Interactions.Status;
|
|
680
|
+
interface FileSearchResultItem {
|
|
681
|
+
title?: string;
|
|
682
|
+
text?: string;
|
|
683
|
+
file_search_store?: string;
|
|
684
|
+
}
|
|
685
|
+
type GenerationConfig = Omit<Interactions.GenerationConfig, "image_config"> & {
|
|
686
|
+
top_k?: number;
|
|
687
|
+
presence_penalty?: number;
|
|
688
|
+
frequency_penalty?: number;
|
|
689
|
+
response_logprobs?: boolean;
|
|
690
|
+
logprobs?: number;
|
|
691
|
+
image_config?: Interactions.ImageConfig & {
|
|
692
|
+
type?: "image";
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
type GoogleMapsCallStepArguments = Interactions.GoogleMapsCallStepArguments;
|
|
696
|
+
type GoogleMapsCallArguments = Interactions.GoogleMapsCallStepArguments;
|
|
697
|
+
type GoogleMapsResultItem = Interactions.GoogleMapsResultItem;
|
|
698
|
+
type GoogleMapsResult = Interactions.GoogleMapsResultItem;
|
|
699
|
+
type GoogleMapsResultPlaces = Interactions.GoogleMapsResultPlaces;
|
|
700
|
+
type GoogleSearchCallStepArguments = Interactions.GoogleSearchCallStepArguments;
|
|
701
|
+
type GoogleSearchResultItem = Interactions.GoogleSearchResultItem;
|
|
702
|
+
type HarmCategory = Interactions.HarmCategory;
|
|
703
|
+
type MediaResolution = Interactions.MediaResolution;
|
|
704
|
+
type ModalityTokens = Interactions.ModalityTokens;
|
|
705
|
+
type Model = Interactions.ModelOption;
|
|
706
|
+
type ModelOption = Interactions.ModelOption;
|
|
707
|
+
type ResponseModality = Interactions.ResponseModality;
|
|
708
|
+
type ReviewSnippet = Interactions.ReviewSnippet;
|
|
709
|
+
type PlaceCitationReviewSnippet = Interactions.ReviewSnippet;
|
|
710
|
+
type RetrievalStepArguments = Interactions.RetrievalStepArguments;
|
|
711
|
+
type RetrievalCallArguments = Interactions.RetrievalStepArguments;
|
|
712
|
+
type SafetySetting = Interactions.SafetySetting;
|
|
713
|
+
type ServiceTier = Interactions.ServiceTier;
|
|
714
|
+
type SpeakerConfig = Interactions.SpeakerConfig;
|
|
715
|
+
type SpeechConfig = Interactions.SpeechConfig;
|
|
716
|
+
type ThinkingLevel = Interactions.ThinkingLevel;
|
|
717
|
+
type ToolChoiceType = "auto" | "any" | "none" | "validated" | (string & {});
|
|
718
|
+
type ToolChoiceConfig = Interactions.ToolChoiceConfig;
|
|
719
|
+
type ToolChoice = ToolChoiceType | ToolChoiceConfig;
|
|
720
|
+
type UrlContextCallStepArguments = Interactions.UrlContextCallArguments;
|
|
721
|
+
type UrlContextCallArguments = Interactions.UrlContextCallArguments;
|
|
722
|
+
type UrlContextResultItem = Interactions.UrlContextResult;
|
|
723
|
+
type UrlContextResult = Interactions.UrlContextResult;
|
|
724
|
+
type Usage = Interactions.Usage;
|
|
725
|
+
type VertexAISearchConfig = Interactions.Tools.VertexAISearchConfig;
|
|
726
|
+
type VertexAiSearchConfig = Interactions.Tools.VertexAISearchConfig;
|
|
727
|
+
type WebhookConfig = Interactions.WebhookConfig;
|
|
728
|
+
type InteractionSseEventInteraction = Omit<Interaction, "steps" | "outputs"> & {
|
|
729
|
+
steps?: Array<Step>;
|
|
730
|
+
outputs?: Array<Step | Content>;
|
|
731
|
+
};
|
|
732
|
+
interface TextDelta {
|
|
733
|
+
type: "text";
|
|
734
|
+
text: string;
|
|
735
|
+
}
|
|
736
|
+
interface TextAnnotationDelta {
|
|
737
|
+
type: "text_annotation_delta" | "text_annotation";
|
|
738
|
+
annotations?: Array<Annotation>;
|
|
739
|
+
}
|
|
740
|
+
interface ImageDelta {
|
|
741
|
+
type: "image";
|
|
742
|
+
data?: string;
|
|
743
|
+
mime_type?: ImageContent["mime_type"];
|
|
744
|
+
resolution?: MediaResolution;
|
|
745
|
+
uri?: string;
|
|
746
|
+
}
|
|
747
|
+
interface AudioDelta {
|
|
748
|
+
type: "audio";
|
|
749
|
+
channels?: number;
|
|
750
|
+
data?: string;
|
|
751
|
+
mime_type?: AudioContent["mime_type"];
|
|
752
|
+
rate?: number;
|
|
753
|
+
sample_rate?: number;
|
|
754
|
+
uri?: string;
|
|
755
|
+
}
|
|
756
|
+
interface DocumentDelta {
|
|
757
|
+
type: "document";
|
|
758
|
+
data?: string;
|
|
759
|
+
mime_type?: DocumentContent["mime_type"];
|
|
760
|
+
uri?: string;
|
|
761
|
+
}
|
|
762
|
+
interface VideoDelta {
|
|
763
|
+
type: "video";
|
|
764
|
+
data?: string;
|
|
765
|
+
mime_type?: VideoContent["mime_type"];
|
|
766
|
+
resolution?: MediaResolution;
|
|
767
|
+
uri?: string;
|
|
768
|
+
}
|
|
769
|
+
interface ThoughtSummaryDelta {
|
|
770
|
+
type: "thought_summary";
|
|
771
|
+
content?: Content;
|
|
772
|
+
}
|
|
773
|
+
interface ThoughtSignatureDelta {
|
|
774
|
+
type: "thought_signature";
|
|
775
|
+
signature?: string;
|
|
776
|
+
}
|
|
777
|
+
interface ArgumentsDelta {
|
|
778
|
+
type: "arguments_delta" | "function_call";
|
|
779
|
+
id?: string;
|
|
780
|
+
name?: string;
|
|
781
|
+
arguments?: string | Record<string, unknown>;
|
|
782
|
+
}
|
|
783
|
+
interface CodeExecutionCallDelta {
|
|
784
|
+
type: "code_execution_call";
|
|
785
|
+
id?: string;
|
|
786
|
+
arguments?: CodeExecutionCallStepArguments;
|
|
787
|
+
signature?: string;
|
|
788
|
+
}
|
|
789
|
+
interface CodeExecutionResultDelta {
|
|
790
|
+
type: "code_execution_result";
|
|
791
|
+
call_id?: string;
|
|
792
|
+
is_error?: boolean;
|
|
793
|
+
result?: string;
|
|
794
|
+
signature?: string;
|
|
795
|
+
}
|
|
796
|
+
interface GoogleSearchCallDelta {
|
|
797
|
+
type: "google_search_call";
|
|
798
|
+
id?: string;
|
|
799
|
+
arguments?: GoogleSearchCallStepArguments;
|
|
800
|
+
signature?: string;
|
|
801
|
+
}
|
|
802
|
+
interface GoogleSearchResultDelta {
|
|
803
|
+
type: "google_search_result";
|
|
804
|
+
call_id?: string;
|
|
805
|
+
is_error?: boolean;
|
|
806
|
+
result?: Array<GoogleSearchResultItem & {
|
|
807
|
+
title?: string;
|
|
808
|
+
url?: string;
|
|
809
|
+
rendered_content?: string;
|
|
810
|
+
}>;
|
|
811
|
+
signature?: string;
|
|
812
|
+
}
|
|
813
|
+
interface UrlContextCallDelta {
|
|
814
|
+
type: "url_context_call";
|
|
815
|
+
id?: string;
|
|
816
|
+
arguments?: UrlContextCallArguments;
|
|
817
|
+
signature?: string;
|
|
818
|
+
}
|
|
819
|
+
interface UrlContextResultDelta {
|
|
820
|
+
type: "url_context_result";
|
|
821
|
+
call_id?: string;
|
|
822
|
+
is_error?: boolean;
|
|
823
|
+
result?: Array<UrlContextResult>;
|
|
824
|
+
signature?: string;
|
|
825
|
+
}
|
|
826
|
+
interface FileSearchCallDelta {
|
|
827
|
+
type: "file_search_call";
|
|
828
|
+
id?: string;
|
|
829
|
+
signature?: string;
|
|
830
|
+
}
|
|
831
|
+
interface FileSearchResultDelta {
|
|
832
|
+
type: "file_search_result";
|
|
833
|
+
call_id?: string;
|
|
834
|
+
result?: Array<FileSearchResultItem>;
|
|
835
|
+
signature?: string;
|
|
836
|
+
}
|
|
837
|
+
interface GoogleMapsCallDelta {
|
|
838
|
+
type: "google_maps_call";
|
|
839
|
+
id?: string;
|
|
840
|
+
arguments?: GoogleMapsCallArguments;
|
|
841
|
+
signature?: string;
|
|
842
|
+
}
|
|
843
|
+
interface GoogleMapsResultDelta {
|
|
844
|
+
type: "google_maps_result";
|
|
845
|
+
call_id?: string;
|
|
846
|
+
result?: Array<GoogleMapsResult>;
|
|
847
|
+
signature?: string;
|
|
848
|
+
}
|
|
849
|
+
interface McpServerToolCallDelta {
|
|
850
|
+
type: "mcp_server_tool_call";
|
|
851
|
+
id?: string;
|
|
852
|
+
name?: string;
|
|
853
|
+
server_name?: string;
|
|
854
|
+
arguments?: string | Record<string, unknown>;
|
|
855
|
+
signature?: string;
|
|
856
|
+
}
|
|
857
|
+
interface McpServerToolResultDelta {
|
|
858
|
+
type: "mcp_server_tool_result";
|
|
859
|
+
call_id?: string;
|
|
860
|
+
name?: string;
|
|
861
|
+
server_name?: string;
|
|
862
|
+
result?: Array<Content> | string | Record<string, unknown>;
|
|
863
|
+
signature?: string;
|
|
864
|
+
}
|
|
865
|
+
interface ProcessingCallDelta {
|
|
866
|
+
type: "processing_call";
|
|
867
|
+
id?: string;
|
|
868
|
+
signature?: string;
|
|
869
|
+
}
|
|
870
|
+
interface ProcessingResultDelta {
|
|
871
|
+
type: "processing_result";
|
|
872
|
+
call_id?: string;
|
|
873
|
+
signature?: string;
|
|
874
|
+
}
|
|
875
|
+
interface RetrievalCallDelta {
|
|
876
|
+
type: "retrieval_call";
|
|
877
|
+
id?: string;
|
|
878
|
+
arguments?: RetrievalCallArguments;
|
|
879
|
+
retrieval_type?: RetrievalCallStep["retrieval_type"];
|
|
880
|
+
signature?: string;
|
|
881
|
+
}
|
|
882
|
+
interface RetrievalResultDelta {
|
|
883
|
+
type: "retrieval_result";
|
|
884
|
+
call_id?: string;
|
|
885
|
+
is_error?: boolean;
|
|
886
|
+
signature?: string;
|
|
887
|
+
}
|
|
888
|
+
type StepDeltaData = TextDelta | TextAnnotationDelta | ImageDelta | AudioDelta | DocumentDelta | VideoDelta | ThoughtSummaryDelta | ThoughtSignatureDelta | ArgumentsDelta | CodeExecutionCallDelta | CodeExecutionResultDelta | GoogleSearchCallDelta | GoogleSearchResultDelta | UrlContextCallDelta | UrlContextResultDelta | FileSearchCallDelta | FileSearchResultDelta | GoogleMapsCallDelta | GoogleMapsResultDelta | McpServerToolCallDelta | McpServerToolResultDelta | ProcessingCallDelta | ProcessingResultDelta | RetrievalCallDelta | RetrievalResultDelta;
|
|
889
|
+
interface InteractionCreatedEvent {
|
|
890
|
+
event_id?: string;
|
|
891
|
+
event_type: "interaction.created" | "interaction.start";
|
|
892
|
+
interaction: InteractionSseEventInteraction;
|
|
893
|
+
}
|
|
894
|
+
interface InteractionCompletedEvent {
|
|
895
|
+
event_id?: string;
|
|
896
|
+
event_type: "interaction.completed" | "interaction.complete";
|
|
897
|
+
interaction: InteractionSseEventInteraction;
|
|
898
|
+
}
|
|
899
|
+
interface InteractionStatusUpdate {
|
|
900
|
+
continuation_token?: string;
|
|
901
|
+
event_id?: string;
|
|
902
|
+
event_type: "interaction.status_update";
|
|
903
|
+
interaction_id: string;
|
|
904
|
+
status: Interaction["status"];
|
|
905
|
+
usage?: Usage;
|
|
906
|
+
}
|
|
907
|
+
interface StepStart {
|
|
908
|
+
event_id?: string;
|
|
909
|
+
event_type: "step.start" | "content.start";
|
|
910
|
+
index: number;
|
|
911
|
+
step?: Step;
|
|
912
|
+
content?: Step | Content;
|
|
913
|
+
}
|
|
914
|
+
interface StepDelta {
|
|
915
|
+
delta: StepDeltaData;
|
|
916
|
+
event_id?: string;
|
|
917
|
+
event_type: "step.delta" | "content.delta";
|
|
918
|
+
index: number;
|
|
919
|
+
metadata?: {
|
|
920
|
+
total_usage?: Usage;
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
interface StepStop {
|
|
924
|
+
event_id?: string;
|
|
925
|
+
event_type: "step.stop" | "content.stop";
|
|
926
|
+
index: number;
|
|
927
|
+
step_usage?: Usage;
|
|
928
|
+
usage?: Usage;
|
|
929
|
+
}
|
|
930
|
+
interface ErrorEvent {
|
|
931
|
+
error?: Error;
|
|
932
|
+
event_id?: string;
|
|
933
|
+
event_type: "error";
|
|
934
|
+
}
|
|
935
|
+
type InteractionSseEvent = InteractionCreatedEvent | InteractionCompletedEvent | InteractionStatusUpdate | StepStart | StepDelta | StepStop | ErrorEvent;
|
|
936
|
+
}
|
|
435
937
|
}
|
|
436
938
|
/**
|
|
437
939
|
* Simplified speaker/name pair for multi-speaker config.
|
|
@@ -458,6 +960,5 @@ export interface SpeechVoicesLanguage {
|
|
|
458
960
|
export type SimplifiedSpeechLanguageConfig = SpeechVoiceLanguage | SpeechVoicesLanguage;
|
|
459
961
|
/** Top-level simplified config: just a voice, or voice+language */
|
|
460
962
|
export type SimplifiedSpeechConfig = SpeechVoice | SimplifiedSpeechLanguageConfig;
|
|
461
|
-
|
|
462
|
-
export type { GenContent };
|
|
963
|
+
export type { GenContent, Interactions };
|
|
463
964
|
//# sourceMappingURL=types.d.ts.map
|