@google/genai 1.41.0 → 1.43.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.
@@ -121,6 +121,38 @@ var Type;
121
121
  */
122
122
  Type["NULL"] = "NULL";
123
123
  })(Type || (Type = {}));
124
+ /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
125
+ var PhishBlockThreshold;
126
+ (function (PhishBlockThreshold) {
127
+ /**
128
+ * Defaults to unspecified.
129
+ */
130
+ PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
131
+ /**
132
+ * Blocks Low and above confidence URL that is risky.
133
+ */
134
+ PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
135
+ /**
136
+ * Blocks Medium and above confidence URL that is risky.
137
+ */
138
+ PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
139
+ /**
140
+ * Blocks High and above confidence URL that is risky.
141
+ */
142
+ PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
143
+ /**
144
+ * Blocks Higher and above confidence URL that is risky.
145
+ */
146
+ PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
147
+ /**
148
+ * Blocks Very high and above confidence URL that is risky.
149
+ */
150
+ PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
151
+ /**
152
+ * Blocks Extremely high confidence URL that is risky.
153
+ */
154
+ PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
155
+ })(PhishBlockThreshold || (PhishBlockThreshold = {}));
124
156
  /** The API spec that the external API implements. This enum is not supported in Gemini API. */
125
157
  var ApiSpec;
126
158
  (function (ApiSpec) {
@@ -191,38 +223,6 @@ var HttpElementLocation;
191
223
  */
192
224
  HttpElementLocation["HTTP_IN_COOKIE"] = "HTTP_IN_COOKIE";
193
225
  })(HttpElementLocation || (HttpElementLocation = {}));
194
- /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
195
- var PhishBlockThreshold;
196
- (function (PhishBlockThreshold) {
197
- /**
198
- * Defaults to unspecified.
199
- */
200
- PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
201
- /**
202
- * Blocks Low and above confidence URL that is risky.
203
- */
204
- PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
205
- /**
206
- * Blocks Medium and above confidence URL that is risky.
207
- */
208
- PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
209
- /**
210
- * Blocks High and above confidence URL that is risky.
211
- */
212
- PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
213
- /**
214
- * Blocks Higher and above confidence URL that is risky.
215
- */
216
- PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
217
- /**
218
- * Blocks Very high and above confidence URL that is risky.
219
- */
220
- PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
221
- /**
222
- * Blocks Extremely high confidence URL that is risky.
223
- */
224
- PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
225
- })(PhishBlockThreshold || (PhishBlockThreshold = {}));
226
226
  /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
227
227
  var Behavior;
228
228
  (function (Behavior) {
@@ -805,6 +805,34 @@ var Environment;
805
805
  */
806
806
  Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
807
807
  })(Environment || (Environment = {}));
808
+ /** Enum for controlling whether the model can generate images of prominent people (celebrities). */
809
+ var ProminentPeople;
810
+ (function (ProminentPeople) {
811
+ /**
812
+ * Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
813
+ */
814
+ ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
815
+ /**
816
+ * Allows the model to generate images of prominent people.
817
+ */
818
+ ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
819
+ /**
820
+ * Prevents the model from generating images of prominent people.
821
+ */
822
+ ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
823
+ })(ProminentPeople || (ProminentPeople = {}));
824
+ /** Enum representing the Vertex embedding API to use. */
825
+ var EmbeddingApiType;
826
+ (function (EmbeddingApiType) {
827
+ /**
828
+ * predict API endpoint (default)
829
+ */
830
+ EmbeddingApiType["PREDICT"] = "PREDICT";
831
+ /**
832
+ * embedContent API Endpoint
833
+ */
834
+ EmbeddingApiType["EMBED_CONTENT"] = "EMBED_CONTENT";
835
+ })(EmbeddingApiType || (EmbeddingApiType = {}));
808
836
  /** Enum that controls the safety filter level for objectionable content. */
809
837
  var SafetyFilterLevel;
810
838
  (function (SafetyFilterLevel) {
@@ -508,8 +508,10 @@ declare interface GoogleMaps {
508
508
  enableWidget?: boolean;
509
509
  }
510
510
 
511
- /** GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
511
+ /** Tool to support web search. */
512
512
  declare interface GoogleSearch {
513
+ /** Different types of search that can be enabled on the GoogleSearch tool. */
514
+ searchTypes?: SearchTypes;
513
515
  /** Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"]. This field is not supported in Gemini API. */
514
516
  excludeDomains?: string[];
515
517
  /** Optional. Sites with confidence level chosen & above this value will be blocked from the search results. This field is not supported in Gemini API. */
@@ -577,6 +579,10 @@ declare interface HttpRetryOptions {
577
579
  attempts?: number;
578
580
  }
579
581
 
582
+ /** Image search for grounding and related configurations. */
583
+ declare interface ImageSearch {
584
+ }
585
+
580
586
  /** Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time. */
581
587
  declare interface Interval {
582
588
  /** Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. */
@@ -639,6 +645,14 @@ export declare class LocalTokenizer {
639
645
  computeTokens(contents: ContentListUnion): Promise<ComputeTokensResult>;
640
646
  }
641
647
 
648
+ /** A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 5. This data type is not supported in Vertex AI. */
649
+ declare interface McpServer {
650
+ /** The name of the MCPServer. */
651
+ name?: string;
652
+ /** A transport that can stream HTTP requests and responses. */
653
+ streamableHttpTransport?: StreamableHttpTransport;
654
+ }
655
+
642
656
  /** The media resolution to use. */
643
657
  declare enum MediaResolution {
644
658
  /**
@@ -968,6 +982,15 @@ declare interface Schema {
968
982
  type?: Type;
969
983
  }
970
984
 
985
+ /** Tool to support computer use. */
986
+ declare interface SearchTypes {
987
+ /** Setting this field enables web search. Only text results are
988
+ returned. */
989
+ webSearch?: WebSearch;
990
+ /** Setting this field enables image search. Image bytes are returned. */
991
+ imageSearch?: ImageSearch;
992
+ }
993
+
971
994
  /** Configuration for a single speaker in a multi speaker setup. */
972
995
  declare interface SpeakerVoiceConfig {
973
996
  /** Required. The name of the speaker. This should be the same as the speaker name used in the prompt. */
@@ -985,6 +1008,20 @@ declare interface SpeechConfig {
985
1008
  multiSpeakerVoiceConfig?: MultiSpeakerVoiceConfig;
986
1009
  }
987
1010
 
1011
+ /** A transport that can stream HTTP requests and responses. Next ID: 6. This data type is not supported in Vertex AI. */
1012
+ declare interface StreamableHttpTransport {
1013
+ /** Optional: Fields for authentication headers, timeouts, etc., if needed. */
1014
+ headers?: Record<string, string>;
1015
+ /** Timeout for SSE read operations. */
1016
+ sseReadTimeout?: string;
1017
+ /** Whether to close the client session when the transport closes. */
1018
+ terminateOnClose?: boolean;
1019
+ /** HTTP timeout for regular operations. */
1020
+ timeout?: string;
1021
+ /** The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp". */
1022
+ url?: string;
1023
+ }
1024
+
988
1025
  /** The thinking features configuration. */
989
1026
  declare interface ThinkingConfig {
990
1027
  /** Indicates whether to include thoughts in the response. If true, thoughts are returned only if the model supports thought and thoughts are available.
@@ -1042,6 +1079,8 @@ declare interface Tool {
1042
1079
  computerUse?: ComputerUse;
1043
1080
  /** Optional. Tool to retrieve knowledge from the File Search Stores. */
1044
1081
  fileSearch?: FileSearch;
1082
+ /** Enables the model to execute Google Search as part of generation. */
1083
+ googleSearch?: GoogleSearch;
1045
1084
  /** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. */
1046
1085
  codeExecution?: ToolCodeExecution;
1047
1086
  /** Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API. */
@@ -1050,12 +1089,12 @@ declare interface Tool {
1050
1089
  functionDeclarations?: FunctionDeclaration[];
1051
1090
  /** Optional. GoogleMaps tool type. Tool to support Google Maps in Model. */
1052
1091
  googleMaps?: GoogleMaps;
1053
- /** Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
1054
- googleSearch?: GoogleSearch;
1055
1092
  /** Optional. Specialized retrieval tool that is powered by Google Search. */
1056
1093
  googleSearchRetrieval?: GoogleSearchRetrieval;
1057
1094
  /** Optional. Tool to support URL context retrieval. */
1058
1095
  urlContext?: UrlContext;
1096
+ /** Optional. MCP Servers to connect to. This field is not supported in Vertex AI. */
1097
+ mcpServers?: McpServer[];
1059
1098
  }
1060
1099
 
1061
1100
  /** Tool that executes code generated by the model, and automatically returns the result to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool. This data type is not supported in Gemini API. */
@@ -1165,4 +1204,10 @@ declare interface VoiceConfig {
1165
1204
  prebuiltVoiceConfig?: PrebuiltVoiceConfig;
1166
1205
  }
1167
1206
 
1207
+ /** Standard web search for grounding and related configurations.
1208
+
1209
+ Only text results are returned. */
1210
+ declare interface WebSearch {
1211
+ }
1212
+
1168
1213
  export { }
@@ -97,6 +97,38 @@ var Type;
97
97
  */
98
98
  Type["NULL"] = "NULL";
99
99
  })(Type || (Type = {}));
100
+ /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
101
+ var PhishBlockThreshold;
102
+ (function (PhishBlockThreshold) {
103
+ /**
104
+ * Defaults to unspecified.
105
+ */
106
+ PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
107
+ /**
108
+ * Blocks Low and above confidence URL that is risky.
109
+ */
110
+ PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
111
+ /**
112
+ * Blocks Medium and above confidence URL that is risky.
113
+ */
114
+ PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
115
+ /**
116
+ * Blocks High and above confidence URL that is risky.
117
+ */
118
+ PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
119
+ /**
120
+ * Blocks Higher and above confidence URL that is risky.
121
+ */
122
+ PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
123
+ /**
124
+ * Blocks Very high and above confidence URL that is risky.
125
+ */
126
+ PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
127
+ /**
128
+ * Blocks Extremely high confidence URL that is risky.
129
+ */
130
+ PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
131
+ })(PhishBlockThreshold || (PhishBlockThreshold = {}));
100
132
  /** The API spec that the external API implements. This enum is not supported in Gemini API. */
101
133
  var ApiSpec;
102
134
  (function (ApiSpec) {
@@ -167,38 +199,6 @@ var HttpElementLocation;
167
199
  */
168
200
  HttpElementLocation["HTTP_IN_COOKIE"] = "HTTP_IN_COOKIE";
169
201
  })(HttpElementLocation || (HttpElementLocation = {}));
170
- /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
171
- var PhishBlockThreshold;
172
- (function (PhishBlockThreshold) {
173
- /**
174
- * Defaults to unspecified.
175
- */
176
- PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
177
- /**
178
- * Blocks Low and above confidence URL that is risky.
179
- */
180
- PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
181
- /**
182
- * Blocks Medium and above confidence URL that is risky.
183
- */
184
- PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
185
- /**
186
- * Blocks High and above confidence URL that is risky.
187
- */
188
- PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
189
- /**
190
- * Blocks Higher and above confidence URL that is risky.
191
- */
192
- PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
193
- /**
194
- * Blocks Very high and above confidence URL that is risky.
195
- */
196
- PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
197
- /**
198
- * Blocks Extremely high confidence URL that is risky.
199
- */
200
- PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
201
- })(PhishBlockThreshold || (PhishBlockThreshold = {}));
202
202
  /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
203
203
  var Behavior;
204
204
  (function (Behavior) {
@@ -781,6 +781,34 @@ var Environment;
781
781
  */
782
782
  Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
783
783
  })(Environment || (Environment = {}));
784
+ /** Enum for controlling whether the model can generate images of prominent people (celebrities). */
785
+ var ProminentPeople;
786
+ (function (ProminentPeople) {
787
+ /**
788
+ * Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
789
+ */
790
+ ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
791
+ /**
792
+ * Allows the model to generate images of prominent people.
793
+ */
794
+ ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
795
+ /**
796
+ * Prevents the model from generating images of prominent people.
797
+ */
798
+ ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
799
+ })(ProminentPeople || (ProminentPeople = {}));
800
+ /** Enum representing the Vertex embedding API to use. */
801
+ var EmbeddingApiType;
802
+ (function (EmbeddingApiType) {
803
+ /**
804
+ * predict API endpoint (default)
805
+ */
806
+ EmbeddingApiType["PREDICT"] = "PREDICT";
807
+ /**
808
+ * embedContent API Endpoint
809
+ */
810
+ EmbeddingApiType["EMBED_CONTENT"] = "EMBED_CONTENT";
811
+ })(EmbeddingApiType || (EmbeddingApiType = {}));
784
812
  /** Enum that controls the safety filter level for objectionable content. */
785
813
  var SafetyFilterLevel;
786
814
  (function (SafetyFilterLevel) {