@firebase/ai 1.4.1 → 2.0.0-20250715195345

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.
Files changed (34) hide show
  1. package/dist/ai-public.d.ts +460 -210
  2. package/dist/ai.d.ts +463 -210
  3. package/dist/esm/{index.esm2017.js → index.esm.js} +349 -276
  4. package/dist/esm/index.esm.js.map +1 -0
  5. package/dist/esm/src/api.d.ts +2 -38
  6. package/dist/esm/src/errors.d.ts +1 -1
  7. package/dist/esm/src/public-types.d.ts +0 -18
  8. package/dist/esm/src/requests/schema-builder.d.ts +25 -6
  9. package/dist/esm/src/types/enums.d.ts +102 -60
  10. package/dist/esm/src/types/error.d.ts +21 -15
  11. package/dist/esm/src/types/imagen/requests.d.ts +53 -19
  12. package/dist/esm/src/types/imagen/responses.d.ts +2 -2
  13. package/dist/esm/src/types/requests.d.ts +69 -7
  14. package/dist/esm/src/types/responses.d.ts +133 -9
  15. package/dist/esm/src/types/schema.d.ts +41 -20
  16. package/dist/index.cjs.js +364 -279
  17. package/dist/index.cjs.js.map +1 -1
  18. package/dist/index.node.cjs.js +364 -279
  19. package/dist/index.node.cjs.js.map +1 -1
  20. package/dist/index.node.mjs +348 -275
  21. package/dist/index.node.mjs.map +1 -1
  22. package/dist/src/api.d.ts +2 -38
  23. package/dist/src/errors.d.ts +1 -1
  24. package/dist/src/public-types.d.ts +0 -18
  25. package/dist/src/requests/schema-builder.d.ts +25 -6
  26. package/dist/src/types/enums.d.ts +102 -60
  27. package/dist/src/types/error.d.ts +21 -15
  28. package/dist/src/types/imagen/requests.d.ts +53 -19
  29. package/dist/src/types/imagen/responses.d.ts +2 -2
  30. package/dist/src/types/requests.d.ts +69 -7
  31. package/dist/src/types/responses.d.ts +133 -9
  32. package/dist/src/types/schema.d.ts +41 -20
  33. package/package.json +11 -11
  34. package/dist/esm/index.esm2017.js.map +0 -1
package/dist/ai.d.ts CHANGED
@@ -46,7 +46,7 @@ export declare class AIError extends FirebaseError {
46
46
  /**
47
47
  * Constructs a new instance of the `AIError` class.
48
48
  *
49
- * @param code - The error code from {@link AIErrorCode}.
49
+ * @param code - The error code from {@link (AIErrorCode:type)}.
50
50
  * @param message - A human-readable message describing the error.
51
51
  * @param customErrorData - Optional error data.
52
52
  */
@@ -58,36 +58,41 @@ export declare class AIError extends FirebaseError {
58
58
  *
59
59
  * @public
60
60
  */
61
- declare const enum AIErrorCode {
61
+ export declare const AIErrorCode: {
62
62
  /** A generic error occurred. */
63
- ERROR = "error",
63
+ readonly ERROR: "error";
64
64
  /** An error occurred in a request. */
65
- REQUEST_ERROR = "request-error",
65
+ readonly REQUEST_ERROR: "request-error";
66
66
  /** An error occurred in a response. */
67
- RESPONSE_ERROR = "response-error",
67
+ readonly RESPONSE_ERROR: "response-error";
68
68
  /** An error occurred while performing a fetch. */
69
- FETCH_ERROR = "fetch-error",
69
+ readonly FETCH_ERROR: "fetch-error";
70
70
  /** An error associated with a Content object. */
71
- INVALID_CONTENT = "invalid-content",
71
+ readonly INVALID_CONTENT: "invalid-content";
72
72
  /** An error due to the Firebase API not being enabled in the Console. */
73
- API_NOT_ENABLED = "api-not-enabled",
73
+ readonly API_NOT_ENABLED: "api-not-enabled";
74
74
  /** An error due to invalid Schema input. */
75
- INVALID_SCHEMA = "invalid-schema",
75
+ readonly INVALID_SCHEMA: "invalid-schema";
76
76
  /** An error occurred due to a missing Firebase API key. */
77
- NO_API_KEY = "no-api-key",
77
+ readonly NO_API_KEY: "no-api-key";
78
78
  /** An error occurred due to a missing Firebase app ID. */
79
- NO_APP_ID = "no-app-id",
79
+ readonly NO_APP_ID: "no-app-id";
80
80
  /** An error occurred due to a model name not being specified during initialization. */
81
- NO_MODEL = "no-model",
81
+ readonly NO_MODEL: "no-model";
82
82
  /** An error occurred due to a missing project ID. */
83
- NO_PROJECT_ID = "no-project-id",
83
+ readonly NO_PROJECT_ID: "no-project-id";
84
84
  /** An error occurred while parsing. */
85
- PARSE_FAILED = "parse-failed",
85
+ readonly PARSE_FAILED: "parse-failed";
86
86
  /** An error occurred due an attempt to use an unsupported feature. */
87
- UNSUPPORTED = "unsupported"
88
- }
89
- export { AIErrorCode }
90
- export { AIErrorCode as VertexAIErrorCode }
87
+ readonly UNSUPPORTED: "unsupported";
88
+ };
89
+
90
+ /**
91
+ * Standardized error codes that {@link AIError} can have.
92
+ *
93
+ * @public
94
+ */
95
+ export declare type AIErrorCode = (typeof AIErrorCode)[keyof typeof AIErrorCode];
91
96
 
92
97
  /**
93
98
  * Base class for Firebase AI model APIs.
@@ -158,6 +163,22 @@ export declare interface AIOptions {
158
163
  backend: Backend;
159
164
  }
160
165
 
166
+ /**
167
+ * Schema class representing a value that can conform to any of the provided sub-schemas. This is
168
+ * useful when a field can accept multiple distinct types or structures.
169
+ * @public
170
+ */
171
+ export declare class AnyOfSchema extends Schema {
172
+ anyOf: TypedSchema[];
173
+ constructor(schemaParams: SchemaParams & {
174
+ anyOf: TypedSchema[];
175
+ });
176
+ /**
177
+ * @internal
178
+ */
179
+ toJSON(): SchemaRequest;
180
+ }
181
+
161
182
  declare interface ApiSettings {
162
183
  apiKey: string;
163
184
  project: string;
@@ -253,24 +274,30 @@ export declare interface BaseParams {
253
274
  * Reason that a prompt was blocked.
254
275
  * @public
255
276
  */
256
- export declare enum BlockReason {
277
+ export declare const BlockReason: {
257
278
  /**
258
279
  * Content was blocked by safety settings.
259
280
  */
260
- SAFETY = "SAFETY",
281
+ readonly SAFETY: "SAFETY";
261
282
  /**
262
283
  * Content was blocked, but the reason is uncategorized.
263
284
  */
264
- OTHER = "OTHER",
285
+ readonly OTHER: "OTHER";
265
286
  /**
266
287
  * Content was blocked because it contained terms from the terminology blocklist.
267
288
  */
268
- BLOCKLIST = "BLOCKLIST",
289
+ readonly BLOCKLIST: "BLOCKLIST";
269
290
  /**
270
291
  * Content was blocked due to prohibited content.
271
292
  */
272
- PROHIBITED_CONTENT = "PROHIBITED_CONTENT"
273
- }
293
+ readonly PROHIBITED_CONTENT: "PROHIBITED_CONTENT";
294
+ };
295
+
296
+ /**
297
+ * Reason that a prompt was blocked.
298
+ * @public
299
+ */
300
+ export declare type BlockReason = (typeof BlockReason)[keyof typeof BlockReason];
274
301
 
275
302
  /**
276
303
  * Schema class for "boolean" types.
@@ -487,44 +514,50 @@ export declare interface FileDataPart {
487
514
  * Reason that a candidate finished.
488
515
  * @public
489
516
  */
490
- export declare enum FinishReason {
517
+ export declare const FinishReason: {
491
518
  /**
492
519
  * Natural stop point of the model or provided stop sequence.
493
520
  */
494
- STOP = "STOP",
521
+ readonly STOP: "STOP";
495
522
  /**
496
523
  * The maximum number of tokens as specified in the request was reached.
497
524
  */
498
- MAX_TOKENS = "MAX_TOKENS",
525
+ readonly MAX_TOKENS: "MAX_TOKENS";
499
526
  /**
500
527
  * The candidate content was flagged for safety reasons.
501
528
  */
502
- SAFETY = "SAFETY",
529
+ readonly SAFETY: "SAFETY";
503
530
  /**
504
531
  * The candidate content was flagged for recitation reasons.
505
532
  */
506
- RECITATION = "RECITATION",
533
+ readonly RECITATION: "RECITATION";
507
534
  /**
508
535
  * Unknown reason.
509
536
  */
510
- OTHER = "OTHER",
537
+ readonly OTHER: "OTHER";
511
538
  /**
512
539
  * The candidate content contained forbidden terms.
513
540
  */
514
- BLOCKLIST = "BLOCKLIST",
541
+ readonly BLOCKLIST: "BLOCKLIST";
515
542
  /**
516
543
  * The candidate content potentially contained prohibited content.
517
544
  */
518
- PROHIBITED_CONTENT = "PROHIBITED_CONTENT",
545
+ readonly PROHIBITED_CONTENT: "PROHIBITED_CONTENT";
519
546
  /**
520
547
  * The candidate content potentially contained Sensitive Personally Identifiable Information (SPII).
521
548
  */
522
- SPII = "SPII",
549
+ readonly SPII: "SPII";
523
550
  /**
524
551
  * The function call generated by the model was invalid.
525
552
  */
526
- MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL"
527
- }
553
+ readonly MALFORMED_FUNCTION_CALL: "MALFORMED_FUNCTION_CALL";
554
+ };
555
+
556
+ /**
557
+ * Reason that a candidate finished.
558
+ * @public
559
+ */
560
+ export declare type FinishReason = (typeof FinishReason)[keyof typeof FinishReason];
528
561
 
529
562
  /**
530
563
  * A predicted {@link FunctionCall} returned from the model
@@ -548,25 +581,27 @@ export declare interface FunctionCallingConfig {
548
581
  /**
549
582
  * @public
550
583
  */
551
- export declare enum FunctionCallingMode {
584
+ export declare const FunctionCallingMode: {
552
585
  /**
553
586
  * Default model behavior; model decides to predict either a function call
554
587
  * or a natural language response.
555
588
  */
556
- AUTO = "AUTO",
589
+ readonly AUTO: "AUTO";
557
590
  /**
558
591
  * Model is constrained to always predicting a function call only.
559
592
  * If `allowed_function_names` is set, the predicted function call will be
560
593
  * limited to any one of `allowed_function_names`, else the predicted
561
594
  * function call will be any one of the provided `function_declarations`.
562
595
  */
563
- ANY = "ANY",
596
+ readonly ANY: "ANY";
564
597
  /**
565
598
  * Model will not predict any function call. Model behavior is same as when
566
599
  * not passing any function declarations.
567
600
  */
568
- NONE = "NONE"
569
- }
601
+ readonly NONE: "NONE";
602
+ };
603
+
604
+ export declare type FunctionCallingMode = (typeof FunctionCallingMode)[keyof typeof FunctionCallingMode];
570
605
 
571
606
  /**
572
607
  * Content part interface if the part represents a {@link FunctionCall}.
@@ -605,7 +640,7 @@ export declare interface FunctionDeclaration {
605
640
  * format. Reflects the Open API 3.03 Parameter Object. Parameter names are
606
641
  * case-sensitive. For a function with no parameters, this can be left unset.
607
642
  */
608
- parameters?: ObjectSchemaInterface;
643
+ parameters?: ObjectSchema | ObjectSchemaRequest;
609
644
  }
610
645
 
611
646
  /**
@@ -738,7 +773,7 @@ export declare interface GenerationConfig {
738
773
  * value can be a class generated with a {@link Schema} static method
739
774
  * like `Schema.string()` or `Schema.object()` or it can be a plain
740
775
  * JS object matching the {@link SchemaRequest} interface.
741
- * <br/>Note: This only applies when the specified `responseMIMEType` supports a schema; currently
776
+ * <br/>Note: This only applies when the specified `responseMimeType` supports a schema; currently
742
777
  * this is limited to `application/json` and `text/x.enum`.
743
778
  */
744
779
  responseSchema?: TypedSchema | SchemaRequest;
@@ -752,6 +787,10 @@ export declare interface GenerationConfig {
752
787
  * @beta
753
788
  */
754
789
  responseModalities?: ResponseModality[];
790
+ /**
791
+ * Configuration for "thinking" behavior of compatible Gemini models.
792
+ */
793
+ thinkingConfig?: ThinkingConfig;
755
794
  }
756
795
 
757
796
  /**
@@ -855,22 +894,6 @@ export declare function getGenerativeModel(ai: AI, modelParams: ModelParams, req
855
894
  */
856
895
  export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel;
857
896
 
858
- /**
859
- * @deprecated Use the new {@link getAI | getAI()} instead. The Vertex AI in Firebase SDK has been
860
- * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
861
- * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
862
- *
863
- * Returns a {@link VertexAI} instance for the given app, configured to use the
864
- * Vertex AI Gemini API. This instance will be
865
- * configured to use the Vertex AI Gemini API.
866
- *
867
- * @param app - The {@link @firebase/app#FirebaseApp} to use.
868
- * @param options - Options to configure the Vertex AI instance, including the location.
869
- *
870
- * @public
871
- */
872
- export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI;
873
-
874
897
  /**
875
898
  * Configuration class for the Gemini Developer API.
876
899
  *
@@ -929,27 +952,113 @@ export declare interface GoogleAIGenerateContentResponse {
929
952
  }
930
953
 
931
954
  /**
932
- * @deprecated
955
+ * Specifies the Google Search configuration.
956
+ *
957
+ * @remarks Currently, this is an empty object, but it's reserved for future configuration options.
958
+ *
959
+ * @public
960
+ */
961
+ export declare interface GoogleSearch {
962
+ }
963
+
964
+ /**
965
+ * A tool that allows a Gemini model to connect to Google Search to access and incorporate
966
+ * up-to-date information from the web into its responses.
967
+ *
968
+ * Important: If using Grounding with Google Search, you are required to comply with the
969
+ * "Grounding with Google Search" usage requirements for your chosen API provider: {@link https://ai.google.dev/gemini-api/terms#grounding-with-google-search | Gemini Developer API}
970
+ * or Vertex AI Gemini API (see {@link https://cloud.google.com/terms/service-terms | Service Terms}
971
+ * section within the Service Specific Terms).
972
+ *
973
+ * @public
974
+ */
975
+ export declare interface GoogleSearchTool {
976
+ /**
977
+ * Specifies the Google Search configuration.
978
+ * Currently, this is an empty object, but it's reserved for future configuration options.
979
+ * Specifies the Google Search configuration. Currently, this is an empty object, but it's
980
+ * reserved for future configuration options.
981
+ *
982
+ * When using this feature, you are required to comply with the "Grounding with Google Search"
983
+ * usage requirements for your chosen API provider: {@link https://ai.google.dev/gemini-api/terms#grounding-with-google-search | Gemini Developer API}
984
+ * or Vertex AI Gemini API (see {@link https://cloud.google.com/terms/service-terms | Service Terms}
985
+ * section within the Service Specific Terms).
986
+ */
987
+ googleSearch: GoogleSearch;
988
+ }
989
+
990
+ /**
991
+ * Represents a chunk of retrieved data that supports a claim in the model's response. This is part
992
+ * of the grounding information provided when grounding is enabled.
993
+ *
933
994
  * @public
934
995
  */
935
- export declare interface GroundingAttribution {
936
- segment: Segment;
937
- confidenceScore?: number;
938
- web?: WebAttribution;
939
- retrievedContext?: RetrievedContextAttribution;
996
+ export declare interface GroundingChunk {
997
+ /**
998
+ * Contains details if the grounding chunk is from a web source.
999
+ */
1000
+ web?: WebGroundingChunk;
940
1001
  }
941
1002
 
942
1003
  /**
943
- * Metadata returned to client when grounding is enabled.
1004
+ * Metadata returned when grounding is enabled.
1005
+ *
1006
+ * Currently, only Grounding with Google Search is supported (see {@link GoogleSearchTool}).
1007
+ *
1008
+ * Important: If using Grounding with Google Search, you are required to comply with the
1009
+ * "Grounding with Google Search" usage requirements for your chosen API provider: {@link https://ai.google.dev/gemini-api/terms#grounding-with-google-search | Gemini Developer API}
1010
+ * or Vertex AI Gemini API (see {@link https://cloud.google.com/terms/service-terms | Service Terms}
1011
+ * section within the Service Specific Terms).
1012
+ *
944
1013
  * @public
945
1014
  */
946
1015
  export declare interface GroundingMetadata {
1016
+ /**
1017
+ * Google Search entry point for web searches. This contains an HTML/CSS snippet that must be
1018
+ * embedded in an app to display a Google Search entry point for follow-up web searches related to
1019
+ * a model's “Grounded Response”.
1020
+ */
1021
+ searchEntryPoint?: SearchEntrypoint;
1022
+ /**
1023
+ * A list of {@link GroundingChunk} objects. Each chunk represents a piece of retrieved content
1024
+ * (for example, from a web page). that the model used to ground its response.
1025
+ */
1026
+ groundingChunks?: GroundingChunk[];
1027
+ /**
1028
+ * A list of {@link GroundingSupport} objects. Each object details how specific segments of the
1029
+ * model's response are supported by the `groundingChunks`.
1030
+ */
1031
+ groundingSupports?: GroundingSupport[];
1032
+ /**
1033
+ * A list of web search queries that the model performed to gather the grounding information.
1034
+ * These can be used to allow users to explore the search results themselves.
1035
+ */
947
1036
  webSearchQueries?: string[];
1037
+ /**
1038
+ * @deprecated Use {@link GroundingSupport} instead.
1039
+ */
948
1040
  retrievalQueries?: string[];
1041
+ }
1042
+
1043
+ /**
1044
+ * Provides information about how a specific segment of the model's response is supported by the
1045
+ * retrieved grounding chunks.
1046
+ *
1047
+ * @public
1048
+ */
1049
+ export declare interface GroundingSupport {
949
1050
  /**
950
- * @deprecated
1051
+ * Specifies the segment of the model's response content that this grounding support pertains to.
951
1052
  */
952
- groundingAttributions: GroundingAttribution[];
1053
+ segment?: Segment;
1054
+ /**
1055
+ * A list of indices that refer to specific {@link GroundingChunk} objects within the
1056
+ * {@link GroundingMetadata.groundingChunks} array. These referenced chunks
1057
+ * are the sources that support the claim made in the associated `segment` of the response.
1058
+ * For example, an array `[1, 3, 4]` means that `groundingChunks[1]`, `groundingChunks[3]`,
1059
+ * and `groundingChunks[4]` are the retrieved content supporting this part of the response.
1060
+ */
1061
+ groundingChunkIndices?: number[];
953
1062
  }
954
1063
 
955
1064
  /**
@@ -957,108 +1066,139 @@ export declare interface GroundingMetadata {
957
1066
  *
958
1067
  * @public
959
1068
  */
960
- export declare enum HarmBlockMethod {
1069
+ export declare const HarmBlockMethod: {
961
1070
  /**
962
1071
  * The harm block method uses both probability and severity scores.
963
1072
  */
964
- SEVERITY = "SEVERITY",
1073
+ readonly SEVERITY: "SEVERITY";
965
1074
  /**
966
1075
  * The harm block method uses the probability score.
967
1076
  */
968
- PROBABILITY = "PROBABILITY"
969
- }
1077
+ readonly PROBABILITY: "PROBABILITY";
1078
+ };
1079
+
1080
+ /**
1081
+ * This property is not supported in the Gemini Developer API ({@link GoogleAIBackend}).
1082
+ *
1083
+ * @public
1084
+ */
1085
+ export declare type HarmBlockMethod = (typeof HarmBlockMethod)[keyof typeof HarmBlockMethod];
970
1086
 
971
1087
  /**
972
1088
  * Threshold above which a prompt or candidate will be blocked.
973
1089
  * @public
974
1090
  */
975
- export declare enum HarmBlockThreshold {
1091
+ export declare const HarmBlockThreshold: {
976
1092
  /**
977
1093
  * Content with `NEGLIGIBLE` will be allowed.
978
1094
  */
979
- BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
1095
+ readonly BLOCK_LOW_AND_ABOVE: "BLOCK_LOW_AND_ABOVE";
980
1096
  /**
981
1097
  * Content with `NEGLIGIBLE` and `LOW` will be allowed.
982
1098
  */
983
- BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
1099
+ readonly BLOCK_MEDIUM_AND_ABOVE: "BLOCK_MEDIUM_AND_ABOVE";
984
1100
  /**
985
1101
  * Content with `NEGLIGIBLE`, `LOW`, and `MEDIUM` will be allowed.
986
1102
  */
987
- BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH",
1103
+ readonly BLOCK_ONLY_HIGH: "BLOCK_ONLY_HIGH";
988
1104
  /**
989
1105
  * All content will be allowed.
990
1106
  */
991
- BLOCK_NONE = "BLOCK_NONE",
1107
+ readonly BLOCK_NONE: "BLOCK_NONE";
992
1108
  /**
993
1109
  * All content will be allowed. This is the same as `BLOCK_NONE`, but the metadata corresponding
994
1110
  * to the {@link HarmCategory} will not be present in the response.
995
1111
  */
996
- OFF = "OFF"
997
- }
1112
+ readonly OFF: "OFF";
1113
+ };
1114
+
1115
+ /**
1116
+ * Threshold above which a prompt or candidate will be blocked.
1117
+ * @public
1118
+ */
1119
+ export declare type HarmBlockThreshold = (typeof HarmBlockThreshold)[keyof typeof HarmBlockThreshold];
998
1120
 
999
1121
  /**
1000
1122
  * Harm categories that would cause prompts or candidates to be blocked.
1001
1123
  * @public
1002
1124
  */
1003
- export declare enum HarmCategory {
1004
- HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH",
1005
- HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT",
1006
- HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT",
1007
- HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT"
1008
- }
1125
+ export declare const HarmCategory: {
1126
+ readonly HARM_CATEGORY_HATE_SPEECH: "HARM_CATEGORY_HATE_SPEECH";
1127
+ readonly HARM_CATEGORY_SEXUALLY_EXPLICIT: "HARM_CATEGORY_SEXUALLY_EXPLICIT";
1128
+ readonly HARM_CATEGORY_HARASSMENT: "HARM_CATEGORY_HARASSMENT";
1129
+ readonly HARM_CATEGORY_DANGEROUS_CONTENT: "HARM_CATEGORY_DANGEROUS_CONTENT";
1130
+ };
1131
+
1132
+ /**
1133
+ * Harm categories that would cause prompts or candidates to be blocked.
1134
+ * @public
1135
+ */
1136
+ export declare type HarmCategory = (typeof HarmCategory)[keyof typeof HarmCategory];
1009
1137
 
1010
1138
  /**
1011
1139
  * Probability that a prompt or candidate matches a harm category.
1012
1140
  * @public
1013
1141
  */
1014
- export declare enum HarmProbability {
1142
+ export declare const HarmProbability: {
1015
1143
  /**
1016
1144
  * Content has a negligible chance of being unsafe.
1017
1145
  */
1018
- NEGLIGIBLE = "NEGLIGIBLE",
1146
+ readonly NEGLIGIBLE: "NEGLIGIBLE";
1019
1147
  /**
1020
1148
  * Content has a low chance of being unsafe.
1021
1149
  */
1022
- LOW = "LOW",
1150
+ readonly LOW: "LOW";
1023
1151
  /**
1024
1152
  * Content has a medium chance of being unsafe.
1025
1153
  */
1026
- MEDIUM = "MEDIUM",
1154
+ readonly MEDIUM: "MEDIUM";
1027
1155
  /**
1028
1156
  * Content has a high chance of being unsafe.
1029
1157
  */
1030
- HIGH = "HIGH"
1031
- }
1158
+ readonly HIGH: "HIGH";
1159
+ };
1160
+
1161
+ /**
1162
+ * Probability that a prompt or candidate matches a harm category.
1163
+ * @public
1164
+ */
1165
+ export declare type HarmProbability = (typeof HarmProbability)[keyof typeof HarmProbability];
1032
1166
 
1033
1167
  /**
1034
1168
  * Harm severity levels.
1035
1169
  * @public
1036
1170
  */
1037
- export declare enum HarmSeverity {
1171
+ export declare const HarmSeverity: {
1038
1172
  /**
1039
1173
  * Negligible level of harm severity.
1040
1174
  */
1041
- HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE",
1175
+ readonly HARM_SEVERITY_NEGLIGIBLE: "HARM_SEVERITY_NEGLIGIBLE";
1042
1176
  /**
1043
1177
  * Low level of harm severity.
1044
1178
  */
1045
- HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW",
1179
+ readonly HARM_SEVERITY_LOW: "HARM_SEVERITY_LOW";
1046
1180
  /**
1047
1181
  * Medium level of harm severity.
1048
1182
  */
1049
- HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM",
1183
+ readonly HARM_SEVERITY_MEDIUM: "HARM_SEVERITY_MEDIUM";
1050
1184
  /**
1051
1185
  * High level of harm severity.
1052
1186
  */
1053
- HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH",
1187
+ readonly HARM_SEVERITY_HIGH: "HARM_SEVERITY_HIGH";
1054
1188
  /**
1055
1189
  * Harm severity is not supported.
1056
1190
  *
1057
1191
  * @remarks
1058
1192
  * The GoogleAI backend does not support `HarmSeverity`, so this value is used as a fallback.
1059
1193
  */
1060
- HARM_SEVERITY_UNSUPPORTED = "HARM_SEVERITY_UNSUPPORTED"
1061
- }
1194
+ readonly HARM_SEVERITY_UNSUPPORTED: "HARM_SEVERITY_UNSUPPORTED";
1195
+ };
1196
+
1197
+ /**
1198
+ * Harm severity levels.
1199
+ * @public
1200
+ */
1201
+ export declare type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity];
1062
1202
 
1063
1203
  /**
1064
1204
  * Aspect ratios for Imagen images.
@@ -1071,28 +1211,41 @@ export declare enum HarmSeverity {
1071
1211
  *
1072
1212
  * @beta
1073
1213
  */
1074
- export declare enum ImagenAspectRatio {
1214
+ export declare const ImagenAspectRatio: {
1075
1215
  /**
1076
1216
  * Square (1:1) aspect ratio.
1077
1217
  */
1078
- SQUARE = "1:1",
1218
+ readonly SQUARE: "1:1";
1079
1219
  /**
1080
1220
  * Landscape (3:4) aspect ratio.
1081
1221
  */
1082
- LANDSCAPE_3x4 = "3:4",
1222
+ readonly LANDSCAPE_3x4: "3:4";
1083
1223
  /**
1084
1224
  * Portrait (4:3) aspect ratio.
1085
1225
  */
1086
- PORTRAIT_4x3 = "4:3",
1226
+ readonly PORTRAIT_4x3: "4:3";
1087
1227
  /**
1088
1228
  * Landscape (16:9) aspect ratio.
1089
1229
  */
1090
- LANDSCAPE_16x9 = "16:9",
1230
+ readonly LANDSCAPE_16x9: "16:9";
1091
1231
  /**
1092
1232
  * Portrait (9:16) aspect ratio.
1093
1233
  */
1094
- PORTRAIT_9x16 = "9:16"
1095
- }
1234
+ readonly PORTRAIT_9x16: "9:16";
1235
+ };
1236
+
1237
+ /**
1238
+ * Aspect ratios for Imagen images.
1239
+ *
1240
+ * To specify an aspect ratio for generated images, set the `aspectRatio` property in your
1241
+ * {@link ImagenGenerationConfig}.
1242
+ *
1243
+ * See the the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation }
1244
+ * for more details and examples of the supported aspect ratios.
1245
+ *
1246
+ * @beta
1247
+ */
1248
+ export declare type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio];
1096
1249
 
1097
1250
  /**
1098
1251
  * An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.
@@ -1144,7 +1297,7 @@ export declare interface ImagenGenerationConfig {
1144
1297
  numberOfImages?: number;
1145
1298
  /**
1146
1299
  * The aspect ratio of the generated images. The default value is square 1:1.
1147
- * Supported aspect ratios depend on the Imagen model, see {@link ImagenAspectRatio}
1300
+ * Supported aspect ratios depend on the Imagen model, see {@link (ImagenAspectRatio:type)}
1148
1301
  * for more details.
1149
1302
  */
1150
1303
  aspectRatio?: ImagenAspectRatio;
@@ -1186,8 +1339,8 @@ export declare interface ImagenGenerationResponse<T extends ImagenInlineImage |
1186
1339
  * The reason that images were filtered out. This property will only be defined if one
1187
1340
  * or more images were filtered.
1188
1341
  *
1189
- * Images may be filtered out due to the {@link ImagenSafetyFilterLevel},
1190
- * {@link ImagenPersonFilterLevel}, or filtering included in the model.
1342
+ * Images may be filtered out due to the {@link (ImagenSafetyFilterLevel:type)},
1343
+ * {@link (ImagenPersonFilterLevel:type)}, or filtering included in the model.
1191
1344
  * The filter levels may be adjusted in your {@link ImagenSafetySettings}.
1192
1345
  *
1193
1346
  * See the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen | Responsible AI and usage guidelines for Imagen}
@@ -1410,11 +1563,11 @@ export declare interface ImagenModelParams {
1410
1563
  *
1411
1564
  * @beta
1412
1565
  */
1413
- export declare enum ImagenPersonFilterLevel {
1566
+ export declare const ImagenPersonFilterLevel: {
1414
1567
  /**
1415
1568
  * Disallow generation of images containing people or faces; images of people are filtered out.
1416
1569
  */
1417
- BLOCK_ALL = "dont_allow",
1570
+ readonly BLOCK_ALL: "dont_allow";
1418
1571
  /**
1419
1572
  * Allow generation of images containing adults only; images of children are filtered out.
1420
1573
  *
@@ -1422,7 +1575,7 @@ export declare enum ImagenPersonFilterLevel {
1422
1575
  * reviewed and approved by Cloud support; see the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen | Responsible AI and usage guidelines}
1423
1576
  * for more details.
1424
1577
  */
1425
- ALLOW_ADULT = "allow_adult",
1578
+ readonly ALLOW_ADULT: "allow_adult";
1426
1579
  /**
1427
1580
  * Allow generation of images containing adults only; images of children are filtered out.
1428
1581
  *
@@ -1430,8 +1583,18 @@ export declare enum ImagenPersonFilterLevel {
1430
1583
  * reviewed and approved by Cloud support; see the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen | Responsible AI and usage guidelines}
1431
1584
  * for more details.
1432
1585
  */
1433
- ALLOW_ALL = "allow_all"
1434
- }
1586
+ readonly ALLOW_ALL: "allow_all";
1587
+ };
1588
+
1589
+ /**
1590
+ * A filter level controlling whether generation of images containing people or faces is allowed.
1591
+ *
1592
+ * See the <a href="http://firebase.google.com/docs/vertex-ai/generate-images">personGeneration</a>
1593
+ * documentation for more details.
1594
+ *
1595
+ * @beta
1596
+ */
1597
+ export declare type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel];
1435
1598
 
1436
1599
  /**
1437
1600
  * A filter level controlling how aggressively to filter sensitive content.
@@ -1445,27 +1608,41 @@ export declare enum ImagenPersonFilterLevel {
1445
1608
  *
1446
1609
  * @beta
1447
1610
  */
1448
- export declare enum ImagenSafetyFilterLevel {
1611
+ export declare const ImagenSafetyFilterLevel: {
1449
1612
  /**
1450
1613
  * The most aggressive filtering level; most strict blocking.
1451
1614
  */
1452
- BLOCK_LOW_AND_ABOVE = "block_low_and_above",
1615
+ readonly BLOCK_LOW_AND_ABOVE: "block_low_and_above";
1453
1616
  /**
1454
1617
  * Blocks some sensitive prompts and responses.
1455
1618
  */
1456
- BLOCK_MEDIUM_AND_ABOVE = "block_medium_and_above",
1619
+ readonly BLOCK_MEDIUM_AND_ABOVE: "block_medium_and_above";
1457
1620
  /**
1458
1621
  * Blocks few sensitive prompts and responses.
1459
1622
  */
1460
- BLOCK_ONLY_HIGH = "block_only_high",
1623
+ readonly BLOCK_ONLY_HIGH: "block_only_high";
1461
1624
  /**
1462
1625
  * The least aggressive filtering level; blocks very few sensitive prompts and responses.
1463
1626
  *
1464
1627
  * Access to this feature is restricted and may require your case to be reviewed and approved by
1465
1628
  * Cloud support.
1466
1629
  */
1467
- BLOCK_NONE = "block_none"
1468
- }
1630
+ readonly BLOCK_NONE: "block_none";
1631
+ };
1632
+
1633
+ /**
1634
+ * A filter level controlling how aggressively to filter sensitive content.
1635
+ *
1636
+ * Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI
1637
+ * are assessed against a list of safety filters, which include 'harmful categories' (for example,
1638
+ * `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to
1639
+ * filter out potentially harmful content from responses. See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation }
1640
+ * and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines}
1641
+ * for more details.
1642
+ *
1643
+ * @beta
1644
+ */
1645
+ export declare type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel];
1469
1646
 
1470
1647
  /**
1471
1648
  * Settings for controlling the aggressiveness of filtering out sensitive content.
@@ -1514,32 +1691,38 @@ export declare class IntegerSchema extends Schema {
1514
1691
  * Content part modality.
1515
1692
  * @public
1516
1693
  */
1517
- export declare enum Modality {
1694
+ export declare const Modality: {
1518
1695
  /**
1519
1696
  * Unspecified modality.
1520
1697
  */
1521
- MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED",
1698
+ readonly MODALITY_UNSPECIFIED: "MODALITY_UNSPECIFIED";
1522
1699
  /**
1523
1700
  * Plain text.
1524
1701
  */
1525
- TEXT = "TEXT",
1702
+ readonly TEXT: "TEXT";
1526
1703
  /**
1527
1704
  * Image.
1528
1705
  */
1529
- IMAGE = "IMAGE",
1706
+ readonly IMAGE: "IMAGE";
1530
1707
  /**
1531
1708
  * Video.
1532
1709
  */
1533
- VIDEO = "VIDEO",
1710
+ readonly VIDEO: "VIDEO";
1534
1711
  /**
1535
1712
  * Audio.
1536
1713
  */
1537
- AUDIO = "AUDIO",
1714
+ readonly AUDIO: "AUDIO";
1538
1715
  /**
1539
1716
  * Document (for example, PDF).
1540
1717
  */
1541
- DOCUMENT = "DOCUMENT"
1542
- }
1718
+ readonly DOCUMENT: "DOCUMENT";
1719
+ };
1720
+
1721
+ /**
1722
+ * Content part modality.
1723
+ * @public
1724
+ */
1725
+ export declare type Modality = (typeof Modality)[keyof typeof Modality];
1543
1726
 
1544
1727
  /**
1545
1728
  * Represents token counting info for a single modality.
@@ -1592,12 +1775,20 @@ export declare class ObjectSchema extends Schema {
1592
1775
  }
1593
1776
 
1594
1777
  /**
1595
- * Interface for {@link ObjectSchema} class.
1778
+ * Interface for JSON parameters in a schema of {@link SchemaType}
1779
+ * "object" when not using the `Schema.object()` helper.
1596
1780
  * @public
1597
1781
  */
1598
- export declare interface ObjectSchemaInterface extends SchemaInterface {
1599
- type: SchemaType.OBJECT;
1600
- optionalProperties?: string[];
1782
+ export declare interface ObjectSchemaRequest extends SchemaRequest {
1783
+ type: 'object';
1784
+ /**
1785
+ * This is not a property accepted in the final request to the backend, but is
1786
+ * a client-side convenience property that is only usable by constructing
1787
+ * a schema through the `Schema.object()` helper method. Populating this
1788
+ * property will cause response errors if the object is not wrapped with
1789
+ * `Schema.object()`.
1790
+ */
1791
+ optionalProperties?: never;
1601
1792
  }
1602
1793
 
1603
1794
  /**
@@ -1756,10 +1947,11 @@ export declare interface SafetySetting {
1756
1947
  */
1757
1948
  export declare abstract class Schema implements SchemaInterface {
1758
1949
  /**
1759
- * Optional. The type of the property. {@link
1760
- * SchemaType}.
1950
+ * Optional. The type of the property.
1951
+ * This can only be undefined when using `anyOf` schemas, which do not have an
1952
+ * explicit type in the {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type | OpenAPI specification}.
1761
1953
  */
1762
- type: SchemaType;
1954
+ type?: SchemaType;
1763
1955
  /** Optional. The format of the property.
1764
1956
  * Supported formats:<br/>
1765
1957
  * <ul>
@@ -1773,9 +1965,9 @@ export declare abstract class Schema implements SchemaInterface {
1773
1965
  description?: string;
1774
1966
  /** Optional. The items of the property. */
1775
1967
  items?: SchemaInterface;
1776
- /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1968
+ /** The minimum number of items (elements) in a schema of {@link (SchemaType:type)} `array`. */
1777
1969
  minItems?: number;
1778
- /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1970
+ /** The maximum number of items (elements) in a schema of {@link (SchemaType:type)} `array`. */
1779
1971
  maxItems?: number;
1780
1972
  /** Optional. Whether the property is nullable. Defaults to false. */
1781
1973
  nullable: boolean;
@@ -1809,6 +2001,9 @@ export declare abstract class Schema implements SchemaInterface {
1809
2001
  static integer(integerParams?: SchemaParams): IntegerSchema;
1810
2002
  static number(numberParams?: SchemaParams): NumberSchema;
1811
2003
  static boolean(booleanParams?: SchemaParams): BooleanSchema;
2004
+ static anyOf(anyOfParams: SchemaParams & {
2005
+ anyOf: TypedSchema[];
2006
+ }): AnyOfSchema;
1812
2007
  }
1813
2008
 
1814
2009
  /**
@@ -1817,10 +2012,10 @@ export declare abstract class Schema implements SchemaInterface {
1817
2012
  */
1818
2013
  export declare interface SchemaInterface extends SchemaShared<SchemaInterface> {
1819
2014
  /**
1820
- * The type of the property. {@link
1821
- * SchemaType}.
2015
+ * The type of the property. this can only be undefined when using `anyof` schemas,
2016
+ * which do not have an explicit type in the {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type | OpenAPI Specification}.
1822
2017
  */
1823
- type: SchemaType;
2018
+ type?: SchemaType;
1824
2019
  }
1825
2020
 
1826
2021
  /**
@@ -1837,10 +2032,10 @@ export declare interface SchemaParams extends SchemaShared<SchemaInterface> {
1837
2032
  */
1838
2033
  export declare interface SchemaRequest extends SchemaShared<SchemaRequest> {
1839
2034
  /**
1840
- * The type of the property. {@link
1841
- * SchemaType}.
2035
+ * The type of the property. this can only be undefined when using `anyOf` schemas,
2036
+ * which do not have an explicit type in the {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type | OpenAPI specification }.
1842
2037
  */
1843
- type: SchemaType;
2038
+ type?: SchemaType;
1844
2039
  /** Optional. Array of required property. */
1845
2040
  required?: string[];
1846
2041
  }
@@ -1851,6 +2046,12 @@ export declare interface SchemaRequest extends SchemaShared<SchemaRequest> {
1851
2046
  * @public
1852
2047
  */
1853
2048
  export declare interface SchemaShared<T> {
2049
+ /**
2050
+ * An array of {@link Schema}. The generated data must be valid against any of the schemas
2051
+ * listed in this array. This allows specifying multiple possible structures or types for a
2052
+ * single field.
2053
+ */
2054
+ anyOf?: T[];
1854
2055
  /** Optional. The format of the property.
1855
2056
  * When using the Gemini Developer API ({@link GoogleAIBackend}), this must be either `'enum'` or
1856
2057
  * `'date-time'`, otherwise requests will fail.
@@ -1866,9 +2067,9 @@ export declare interface SchemaShared<T> {
1866
2067
  title?: string;
1867
2068
  /** Optional. The items of the property. */
1868
2069
  items?: T;
1869
- /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
2070
+ /** The minimum number of items (elements) in a schema of {@link (SchemaType:type)} `array`. */
1870
2071
  minItems?: number;
1871
- /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
2072
+ /** The maximum number of items (elements) in a schema of {@link (SchemaType:type)} `array`. */
1872
2073
  maxItems?: number;
1873
2074
  /** Optional. Map of `Schema` objects. */
1874
2075
  properties?: {
@@ -1889,50 +2090,88 @@ export declare interface SchemaShared<T> {
1889
2090
  [key: string]: unknown;
1890
2091
  }
1891
2092
 
1892
- /**
1893
- * @license
1894
- * Copyright 2024 Google LLC
1895
- *
1896
- * Licensed under the Apache License, Version 2.0 (the "License");
1897
- * you may not use this file except in compliance with the License.
1898
- * You may obtain a copy of the License at
1899
- *
1900
- * http://www.apache.org/licenses/LICENSE-2.0
1901
- *
1902
- * Unless required by applicable law or agreed to in writing, software
1903
- * distributed under the License is distributed on an "AS IS" BASIS,
1904
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1905
- * See the License for the specific language governing permissions and
1906
- * limitations under the License.
1907
- */
1908
2093
  /**
1909
2094
  * Contains the list of OpenAPI data types
1910
2095
  * as defined by the
1911
2096
  * {@link https://swagger.io/docs/specification/data-models/data-types/ | OpenAPI specification}
1912
2097
  * @public
1913
2098
  */
1914
- export declare enum SchemaType {
2099
+ export declare const SchemaType: {
1915
2100
  /** String type. */
1916
- STRING = "string",
2101
+ readonly STRING: "string";
1917
2102
  /** Number type. */
1918
- NUMBER = "number",
2103
+ readonly NUMBER: "number";
1919
2104
  /** Integer type. */
1920
- INTEGER = "integer",
2105
+ readonly INTEGER: "integer";
1921
2106
  /** Boolean type. */
1922
- BOOLEAN = "boolean",
2107
+ readonly BOOLEAN: "boolean";
1923
2108
  /** Array type. */
1924
- ARRAY = "array",
2109
+ readonly ARRAY: "array";
1925
2110
  /** Object type. */
1926
- OBJECT = "object"
2111
+ readonly OBJECT: "object";
2112
+ };
2113
+
2114
+ /**
2115
+ * Contains the list of OpenAPI data types
2116
+ * as defined by the
2117
+ * {@link https://swagger.io/docs/specification/data-models/data-types/ | OpenAPI specification}
2118
+ * @public
2119
+ */
2120
+ export declare type SchemaType = (typeof SchemaType)[keyof typeof SchemaType];
2121
+
2122
+ /**
2123
+ * Google search entry point.
2124
+ *
2125
+ * @public
2126
+ */
2127
+ export declare interface SearchEntrypoint {
2128
+ /**
2129
+ * HTML/CSS snippet that must be embedded in a web page. The snippet is designed to avoid
2130
+ * undesired interaction with the rest of the page's CSS.
2131
+ *
2132
+ * To ensure proper rendering and prevent CSS conflicts, it is recommended
2133
+ * to encapsulate this `renderedContent` within a shadow DOM when embedding it
2134
+ * into a webpage. See {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM | MDN: Using shadow DOM}.
2135
+ *
2136
+ * @example
2137
+ * ```javascript
2138
+ * const container = document.createElement('div');
2139
+ * document.body.appendChild(container);
2140
+ * container.attachShadow({ mode: 'open' }).innerHTML = renderedContent;
2141
+ * ```
2142
+ */
2143
+ renderedContent?: string;
1927
2144
  }
1928
2145
 
1929
2146
  /**
2147
+ * Represents a specific segment within a {@link Content} object, often used to
2148
+ * pinpoint the exact location of text or data that grounding information refers to.
2149
+ *
1930
2150
  * @public
1931
2151
  */
1932
2152
  export declare interface Segment {
2153
+ /**
2154
+ * The zero-based index of the {@link Part} object within the `parts` array
2155
+ * of its parent {@link Content} object. This identifies which part of the
2156
+ * content the segment belongs to.
2157
+ */
1933
2158
  partIndex: number;
2159
+ /**
2160
+ * The zero-based start index of the segment within the specified `Part`,
2161
+ * measured in UTF-8 bytes. This offset is inclusive, starting from 0 at the
2162
+ * beginning of the part's content (e.g., `Part.text`).
2163
+ */
1934
2164
  startIndex: number;
2165
+ /**
2166
+ * The zero-based end index of the segment within the specified `Part`,
2167
+ * measured in UTF-8 bytes. This offset is exclusive, meaning the character
2168
+ * at this index is not included in the segment.
2169
+ */
1935
2170
  endIndex: number;
2171
+ /**
2172
+ * The text corresponding to the segment from the response.
2173
+ */
2174
+ text: string;
1936
2175
  }
1937
2176
 
1938
2177
  /**
@@ -1971,11 +2210,36 @@ export declare interface TextPart {
1971
2210
  functionResponse?: never;
1972
2211
  }
1973
2212
 
2213
+ /**
2214
+ * Configuration for "thinking" behavior of compatible Gemini models.
2215
+ *
2216
+ * Certain models utilize a thinking process before generating a response. This allows them to
2217
+ * reason through complex problems and plan a more coherent and accurate answer.
2218
+ *
2219
+ * @public
2220
+ */
2221
+ export declare interface ThinkingConfig {
2222
+ /**
2223
+ * The thinking budget, in tokens.
2224
+ *
2225
+ * This parameter sets an upper limit on the number of tokens the model can use for its internal
2226
+ * "thinking" process. A higher budget may result in higher quality responses for complex tasks
2227
+ * but can also increase latency and cost.
2228
+ *
2229
+ * If you don't specify a budget, the model will determine the appropriate amount
2230
+ * of thinking based on the complexity of the prompt.
2231
+ *
2232
+ * An error will be thrown if you set a thinking budget for a model that does not support this
2233
+ * feature or if the specified budget is not within the model's supported range.
2234
+ */
2235
+ thinkingBudget?: number;
2236
+ }
2237
+
1974
2238
  /**
1975
2239
  * Defines a tool that model can call to access external knowledge.
1976
2240
  * @public
1977
2241
  */
1978
- export declare type Tool = FunctionDeclarationsTool;
2242
+ export declare type Tool = FunctionDeclarationsTool | GoogleSearchTool;
1979
2243
 
1980
2244
  /**
1981
2245
  * Tool config. This config is shared for all tools provided in the request.
@@ -1989,7 +2253,7 @@ export declare interface ToolConfig {
1989
2253
  * A type that includes all specific Schema types.
1990
2254
  * @public
1991
2255
  */
1992
- export declare type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema;
2256
+ export declare type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema | AnyOfSchema;
1993
2257
 
1994
2258
  /**
1995
2259
  * Usage metadata about a {@link GenerateContentResponse}.
@@ -1999,22 +2263,15 @@ export declare type TypedSchema = IntegerSchema | NumberSchema | StringSchema |
1999
2263
  export declare interface UsageMetadata {
2000
2264
  promptTokenCount: number;
2001
2265
  candidatesTokenCount: number;
2266
+ /**
2267
+ * The number of tokens used by the model's internal "thinking" process.
2268
+ */
2269
+ thoughtsTokenCount?: number;
2002
2270
  totalTokenCount: number;
2003
2271
  promptTokensDetails?: ModalityTokenCount[];
2004
2272
  candidatesTokensDetails?: ModalityTokenCount[];
2005
2273
  }
2006
2274
 
2007
- /**
2008
- * @deprecated Use the new {@link AI | AI} instead. The Vertex AI in Firebase SDK has been
2009
- * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
2010
- * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
2011
- *
2012
- * An instance of the Firebase AI SDK.
2013
- *
2014
- * @public
2015
- */
2016
- export declare type VertexAI = AI;
2017
-
2018
2275
  /**
2019
2276
  * Configuration class for the Vertex AI Gemini API.
2020
2277
  *
@@ -2040,37 +2297,6 @@ export declare class VertexAIBackend extends Backend {
2040
2297
  constructor(location?: string);
2041
2298
  }
2042
2299
 
2043
- /**
2044
- * @deprecated Use the new {@link AIError} instead. The Vertex AI in Firebase SDK has been
2045
- * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
2046
- * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
2047
- *
2048
- * Error class for the Firebase AI SDK.
2049
- *
2050
- * @public
2051
- */
2052
- export declare const VertexAIError: typeof AIError;
2053
-
2054
- /**
2055
- * @deprecated Use the new {@link AIModel} instead. The Vertex AI in Firebase SDK has been
2056
- * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
2057
- * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
2058
- *
2059
- * Base class for Firebase AI model APIs.
2060
- *
2061
- * @public
2062
- */
2063
- export declare const VertexAIModel: typeof AIModel;
2064
-
2065
- /**
2066
- * Options when initializing the Firebase AI SDK.
2067
- *
2068
- * @public
2069
- */
2070
- export declare interface VertexAIOptions {
2071
- location?: string;
2072
- }
2073
-
2074
2300
  /**
2075
2301
  * Describes the input video content.
2076
2302
  * @public
@@ -2096,4 +2322,31 @@ export declare interface WebAttribution {
2096
2322
  title: string;
2097
2323
  }
2098
2324
 
2325
+ /**
2326
+ * A grounding chunk from the web.
2327
+ *
2328
+ * Important: If using Grounding with Google Search, you are required to comply with the
2329
+ * {@link https://cloud.google.com/terms/service-terms | Service Specific Terms} for "Grounding with Google Search".
2330
+ *
2331
+ * @public
2332
+ */
2333
+ export declare interface WebGroundingChunk {
2334
+ /**
2335
+ * The URI of the retrieved web page.
2336
+ */
2337
+ uri?: string;
2338
+ /**
2339
+ * The title of the retrieved web page.
2340
+ */
2341
+ title?: string;
2342
+ /**
2343
+ * The domain of the original URI from which the content was retrieved.
2344
+ *
2345
+ * This property is only supported in the Vertex AI Gemini API ({@link VertexAIBackend}).
2346
+ * When using the Gemini Developer API ({@link GoogleAIBackend}), this property will be
2347
+ * `undefined`.
2348
+ */
2349
+ domain?: string;
2350
+ }
2351
+
2099
2352
  export { }