@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
@@ -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.
@@ -124,6 +129,19 @@ export declare interface AIOptions {
124
129
  backend: Backend;
125
130
  }
126
131
 
132
+ /**
133
+ * Schema class representing a value that can conform to any of the provided sub-schemas. This is
134
+ * useful when a field can accept multiple distinct types or structures.
135
+ * @public
136
+ */
137
+ export declare class AnyOfSchema extends Schema {
138
+ anyOf: TypedSchema[];
139
+ constructor(schemaParams: SchemaParams & {
140
+ anyOf: TypedSchema[];
141
+ });
142
+ /* Excluded from this release type: toJSON */
143
+ }
144
+
127
145
  declare interface ApiSettings {
128
146
  apiKey: string;
129
147
  project: string;
@@ -216,24 +234,30 @@ export declare interface BaseParams {
216
234
  * Reason that a prompt was blocked.
217
235
  * @public
218
236
  */
219
- export declare enum BlockReason {
237
+ export declare const BlockReason: {
220
238
  /**
221
239
  * Content was blocked by safety settings.
222
240
  */
223
- SAFETY = "SAFETY",
241
+ readonly SAFETY: "SAFETY";
224
242
  /**
225
243
  * Content was blocked, but the reason is uncategorized.
226
244
  */
227
- OTHER = "OTHER",
245
+ readonly OTHER: "OTHER";
228
246
  /**
229
247
  * Content was blocked because it contained terms from the terminology blocklist.
230
248
  */
231
- BLOCKLIST = "BLOCKLIST",
249
+ readonly BLOCKLIST: "BLOCKLIST";
232
250
  /**
233
251
  * Content was blocked due to prohibited content.
234
252
  */
235
- PROHIBITED_CONTENT = "PROHIBITED_CONTENT"
236
- }
253
+ readonly PROHIBITED_CONTENT: "PROHIBITED_CONTENT";
254
+ };
255
+
256
+ /**
257
+ * Reason that a prompt was blocked.
258
+ * @public
259
+ */
260
+ export declare type BlockReason = (typeof BlockReason)[keyof typeof BlockReason];
237
261
 
238
262
  /**
239
263
  * Schema class for "boolean" types.
@@ -450,44 +474,50 @@ export declare interface FileDataPart {
450
474
  * Reason that a candidate finished.
451
475
  * @public
452
476
  */
453
- export declare enum FinishReason {
477
+ export declare const FinishReason: {
454
478
  /**
455
479
  * Natural stop point of the model or provided stop sequence.
456
480
  */
457
- STOP = "STOP",
481
+ readonly STOP: "STOP";
458
482
  /**
459
483
  * The maximum number of tokens as specified in the request was reached.
460
484
  */
461
- MAX_TOKENS = "MAX_TOKENS",
485
+ readonly MAX_TOKENS: "MAX_TOKENS";
462
486
  /**
463
487
  * The candidate content was flagged for safety reasons.
464
488
  */
465
- SAFETY = "SAFETY",
489
+ readonly SAFETY: "SAFETY";
466
490
  /**
467
491
  * The candidate content was flagged for recitation reasons.
468
492
  */
469
- RECITATION = "RECITATION",
493
+ readonly RECITATION: "RECITATION";
470
494
  /**
471
495
  * Unknown reason.
472
496
  */
473
- OTHER = "OTHER",
497
+ readonly OTHER: "OTHER";
474
498
  /**
475
499
  * The candidate content contained forbidden terms.
476
500
  */
477
- BLOCKLIST = "BLOCKLIST",
501
+ readonly BLOCKLIST: "BLOCKLIST";
478
502
  /**
479
503
  * The candidate content potentially contained prohibited content.
480
504
  */
481
- PROHIBITED_CONTENT = "PROHIBITED_CONTENT",
505
+ readonly PROHIBITED_CONTENT: "PROHIBITED_CONTENT";
482
506
  /**
483
507
  * The candidate content potentially contained Sensitive Personally Identifiable Information (SPII).
484
508
  */
485
- SPII = "SPII",
509
+ readonly SPII: "SPII";
486
510
  /**
487
511
  * The function call generated by the model was invalid.
488
512
  */
489
- MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL"
490
- }
513
+ readonly MALFORMED_FUNCTION_CALL: "MALFORMED_FUNCTION_CALL";
514
+ };
515
+
516
+ /**
517
+ * Reason that a candidate finished.
518
+ * @public
519
+ */
520
+ export declare type FinishReason = (typeof FinishReason)[keyof typeof FinishReason];
491
521
 
492
522
  /**
493
523
  * A predicted {@link FunctionCall} returned from the model
@@ -511,25 +541,27 @@ export declare interface FunctionCallingConfig {
511
541
  /**
512
542
  * @public
513
543
  */
514
- export declare enum FunctionCallingMode {
544
+ export declare const FunctionCallingMode: {
515
545
  /**
516
546
  * Default model behavior; model decides to predict either a function call
517
547
  * or a natural language response.
518
548
  */
519
- AUTO = "AUTO",
549
+ readonly AUTO: "AUTO";
520
550
  /**
521
551
  * Model is constrained to always predicting a function call only.
522
552
  * If `allowed_function_names` is set, the predicted function call will be
523
553
  * limited to any one of `allowed_function_names`, else the predicted
524
554
  * function call will be any one of the provided `function_declarations`.
525
555
  */
526
- ANY = "ANY",
556
+ readonly ANY: "ANY";
527
557
  /**
528
558
  * Model will not predict any function call. Model behavior is same as when
529
559
  * not passing any function declarations.
530
560
  */
531
- NONE = "NONE"
532
- }
561
+ readonly NONE: "NONE";
562
+ };
563
+
564
+ export declare type FunctionCallingMode = (typeof FunctionCallingMode)[keyof typeof FunctionCallingMode];
533
565
 
534
566
  /**
535
567
  * Content part interface if the part represents a {@link FunctionCall}.
@@ -568,7 +600,7 @@ export declare interface FunctionDeclaration {
568
600
  * format. Reflects the Open API 3.03 Parameter Object. Parameter names are
569
601
  * case-sensitive. For a function with no parameters, this can be left unset.
570
602
  */
571
- parameters?: ObjectSchemaInterface;
603
+ parameters?: ObjectSchema | ObjectSchemaRequest;
572
604
  }
573
605
 
574
606
  /**
@@ -701,7 +733,7 @@ export declare interface GenerationConfig {
701
733
  * value can be a class generated with a {@link Schema} static method
702
734
  * like `Schema.string()` or `Schema.object()` or it can be a plain
703
735
  * JS object matching the {@link SchemaRequest} interface.
704
- * <br/>Note: This only applies when the specified `responseMIMEType` supports a schema; currently
736
+ * <br/>Note: This only applies when the specified `responseMimeType` supports a schema; currently
705
737
  * this is limited to `application/json` and `text/x.enum`.
706
738
  */
707
739
  responseSchema?: TypedSchema | SchemaRequest;
@@ -715,6 +747,10 @@ export declare interface GenerationConfig {
715
747
  * @beta
716
748
  */
717
749
  responseModalities?: ResponseModality[];
750
+ /**
751
+ * Configuration for "thinking" behavior of compatible Gemini models.
752
+ */
753
+ thinkingConfig?: ThinkingConfig;
718
754
  }
719
755
 
720
756
  /**
@@ -818,22 +854,6 @@ export declare function getGenerativeModel(ai: AI, modelParams: ModelParams, req
818
854
  */
819
855
  export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel;
820
856
 
821
- /**
822
- * @deprecated Use the new {@link getAI | getAI()} instead. The Vertex AI in Firebase SDK has been
823
- * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
824
- * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
825
- *
826
- * Returns a {@link VertexAI} instance for the given app, configured to use the
827
- * Vertex AI Gemini API. This instance will be
828
- * configured to use the Vertex AI Gemini API.
829
- *
830
- * @param app - The {@link @firebase/app#FirebaseApp} to use.
831
- * @param options - Options to configure the Vertex AI instance, including the location.
832
- *
833
- * @public
834
- */
835
- export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI;
836
-
837
857
  /**
838
858
  * Configuration class for the Gemini Developer API.
839
859
  *
@@ -858,27 +878,113 @@ export declare class GoogleAIBackend extends Backend {
858
878
  /* Excluded from this release type: GoogleAIGenerateContentResponse */
859
879
 
860
880
  /**
861
- * @deprecated
881
+ * Specifies the Google Search configuration.
882
+ *
883
+ * @remarks Currently, this is an empty object, but it's reserved for future configuration options.
884
+ *
885
+ * @public
886
+ */
887
+ export declare interface GoogleSearch {
888
+ }
889
+
890
+ /**
891
+ * A tool that allows a Gemini model to connect to Google Search to access and incorporate
892
+ * up-to-date information from the web into its responses.
893
+ *
894
+ * Important: If using Grounding with Google Search, you are required to comply with the
895
+ * "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}
896
+ * or Vertex AI Gemini API (see {@link https://cloud.google.com/terms/service-terms | Service Terms}
897
+ * section within the Service Specific Terms).
898
+ *
899
+ * @public
900
+ */
901
+ export declare interface GoogleSearchTool {
902
+ /**
903
+ * Specifies the Google Search configuration.
904
+ * Currently, this is an empty object, but it's reserved for future configuration options.
905
+ * Specifies the Google Search configuration. Currently, this is an empty object, but it's
906
+ * reserved for future configuration options.
907
+ *
908
+ * When using this feature, you are required to comply with the "Grounding with Google Search"
909
+ * usage requirements for your chosen API provider: {@link https://ai.google.dev/gemini-api/terms#grounding-with-google-search | Gemini Developer API}
910
+ * or Vertex AI Gemini API (see {@link https://cloud.google.com/terms/service-terms | Service Terms}
911
+ * section within the Service Specific Terms).
912
+ */
913
+ googleSearch: GoogleSearch;
914
+ }
915
+
916
+ /**
917
+ * Represents a chunk of retrieved data that supports a claim in the model's response. This is part
918
+ * of the grounding information provided when grounding is enabled.
919
+ *
862
920
  * @public
863
921
  */
864
- export declare interface GroundingAttribution {
865
- segment: Segment;
866
- confidenceScore?: number;
867
- web?: WebAttribution;
868
- retrievedContext?: RetrievedContextAttribution;
922
+ export declare interface GroundingChunk {
923
+ /**
924
+ * Contains details if the grounding chunk is from a web source.
925
+ */
926
+ web?: WebGroundingChunk;
869
927
  }
870
928
 
871
929
  /**
872
- * Metadata returned to client when grounding is enabled.
930
+ * Metadata returned when grounding is enabled.
931
+ *
932
+ * Currently, only Grounding with Google Search is supported (see {@link GoogleSearchTool}).
933
+ *
934
+ * Important: If using Grounding with Google Search, you are required to comply with the
935
+ * "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}
936
+ * or Vertex AI Gemini API (see {@link https://cloud.google.com/terms/service-terms | Service Terms}
937
+ * section within the Service Specific Terms).
938
+ *
873
939
  * @public
874
940
  */
875
941
  export declare interface GroundingMetadata {
942
+ /**
943
+ * Google Search entry point for web searches. This contains an HTML/CSS snippet that must be
944
+ * embedded in an app to display a Google Search entry point for follow-up web searches related to
945
+ * a model's “Grounded Response”.
946
+ */
947
+ searchEntryPoint?: SearchEntrypoint;
948
+ /**
949
+ * A list of {@link GroundingChunk} objects. Each chunk represents a piece of retrieved content
950
+ * (for example, from a web page). that the model used to ground its response.
951
+ */
952
+ groundingChunks?: GroundingChunk[];
953
+ /**
954
+ * A list of {@link GroundingSupport} objects. Each object details how specific segments of the
955
+ * model's response are supported by the `groundingChunks`.
956
+ */
957
+ groundingSupports?: GroundingSupport[];
958
+ /**
959
+ * A list of web search queries that the model performed to gather the grounding information.
960
+ * These can be used to allow users to explore the search results themselves.
961
+ */
876
962
  webSearchQueries?: string[];
963
+ /**
964
+ * @deprecated Use {@link GroundingSupport} instead.
965
+ */
877
966
  retrievalQueries?: string[];
967
+ }
968
+
969
+ /**
970
+ * Provides information about how a specific segment of the model's response is supported by the
971
+ * retrieved grounding chunks.
972
+ *
973
+ * @public
974
+ */
975
+ export declare interface GroundingSupport {
976
+ /**
977
+ * Specifies the segment of the model's response content that this grounding support pertains to.
978
+ */
979
+ segment?: Segment;
878
980
  /**
879
- * @deprecated
981
+ * A list of indices that refer to specific {@link GroundingChunk} objects within the
982
+ * {@link GroundingMetadata.groundingChunks} array. These referenced chunks
983
+ * are the sources that support the claim made in the associated `segment` of the response.
984
+ * For example, an array `[1, 3, 4]` means that `groundingChunks[1]`, `groundingChunks[3]`,
985
+ * and `groundingChunks[4]` are the retrieved content supporting this part of the response.
880
986
  */
881
- groundingAttributions: GroundingAttribution[];
987
+ groundingChunkIndices?: number[];
882
988
  }
883
989
 
884
990
  /**
@@ -886,108 +992,139 @@ export declare interface GroundingMetadata {
886
992
  *
887
993
  * @public
888
994
  */
889
- export declare enum HarmBlockMethod {
995
+ export declare const HarmBlockMethod: {
890
996
  /**
891
997
  * The harm block method uses both probability and severity scores.
892
998
  */
893
- SEVERITY = "SEVERITY",
999
+ readonly SEVERITY: "SEVERITY";
894
1000
  /**
895
1001
  * The harm block method uses the probability score.
896
1002
  */
897
- PROBABILITY = "PROBABILITY"
898
- }
1003
+ readonly PROBABILITY: "PROBABILITY";
1004
+ };
1005
+
1006
+ /**
1007
+ * This property is not supported in the Gemini Developer API ({@link GoogleAIBackend}).
1008
+ *
1009
+ * @public
1010
+ */
1011
+ export declare type HarmBlockMethod = (typeof HarmBlockMethod)[keyof typeof HarmBlockMethod];
899
1012
 
900
1013
  /**
901
1014
  * Threshold above which a prompt or candidate will be blocked.
902
1015
  * @public
903
1016
  */
904
- export declare enum HarmBlockThreshold {
1017
+ export declare const HarmBlockThreshold: {
905
1018
  /**
906
1019
  * Content with `NEGLIGIBLE` will be allowed.
907
1020
  */
908
- BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
1021
+ readonly BLOCK_LOW_AND_ABOVE: "BLOCK_LOW_AND_ABOVE";
909
1022
  /**
910
1023
  * Content with `NEGLIGIBLE` and `LOW` will be allowed.
911
1024
  */
912
- BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
1025
+ readonly BLOCK_MEDIUM_AND_ABOVE: "BLOCK_MEDIUM_AND_ABOVE";
913
1026
  /**
914
1027
  * Content with `NEGLIGIBLE`, `LOW`, and `MEDIUM` will be allowed.
915
1028
  */
916
- BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH",
1029
+ readonly BLOCK_ONLY_HIGH: "BLOCK_ONLY_HIGH";
917
1030
  /**
918
1031
  * All content will be allowed.
919
1032
  */
920
- BLOCK_NONE = "BLOCK_NONE",
1033
+ readonly BLOCK_NONE: "BLOCK_NONE";
921
1034
  /**
922
1035
  * All content will be allowed. This is the same as `BLOCK_NONE`, but the metadata corresponding
923
1036
  * to the {@link HarmCategory} will not be present in the response.
924
1037
  */
925
- OFF = "OFF"
926
- }
1038
+ readonly OFF: "OFF";
1039
+ };
1040
+
1041
+ /**
1042
+ * Threshold above which a prompt or candidate will be blocked.
1043
+ * @public
1044
+ */
1045
+ export declare type HarmBlockThreshold = (typeof HarmBlockThreshold)[keyof typeof HarmBlockThreshold];
927
1046
 
928
1047
  /**
929
1048
  * Harm categories that would cause prompts or candidates to be blocked.
930
1049
  * @public
931
1050
  */
932
- export declare enum HarmCategory {
933
- HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH",
934
- HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT",
935
- HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT",
936
- HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT"
937
- }
1051
+ export declare const HarmCategory: {
1052
+ readonly HARM_CATEGORY_HATE_SPEECH: "HARM_CATEGORY_HATE_SPEECH";
1053
+ readonly HARM_CATEGORY_SEXUALLY_EXPLICIT: "HARM_CATEGORY_SEXUALLY_EXPLICIT";
1054
+ readonly HARM_CATEGORY_HARASSMENT: "HARM_CATEGORY_HARASSMENT";
1055
+ readonly HARM_CATEGORY_DANGEROUS_CONTENT: "HARM_CATEGORY_DANGEROUS_CONTENT";
1056
+ };
1057
+
1058
+ /**
1059
+ * Harm categories that would cause prompts or candidates to be blocked.
1060
+ * @public
1061
+ */
1062
+ export declare type HarmCategory = (typeof HarmCategory)[keyof typeof HarmCategory];
938
1063
 
939
1064
  /**
940
1065
  * Probability that a prompt or candidate matches a harm category.
941
1066
  * @public
942
1067
  */
943
- export declare enum HarmProbability {
1068
+ export declare const HarmProbability: {
944
1069
  /**
945
1070
  * Content has a negligible chance of being unsafe.
946
1071
  */
947
- NEGLIGIBLE = "NEGLIGIBLE",
1072
+ readonly NEGLIGIBLE: "NEGLIGIBLE";
948
1073
  /**
949
1074
  * Content has a low chance of being unsafe.
950
1075
  */
951
- LOW = "LOW",
1076
+ readonly LOW: "LOW";
952
1077
  /**
953
1078
  * Content has a medium chance of being unsafe.
954
1079
  */
955
- MEDIUM = "MEDIUM",
1080
+ readonly MEDIUM: "MEDIUM";
956
1081
  /**
957
1082
  * Content has a high chance of being unsafe.
958
1083
  */
959
- HIGH = "HIGH"
960
- }
1084
+ readonly HIGH: "HIGH";
1085
+ };
1086
+
1087
+ /**
1088
+ * Probability that a prompt or candidate matches a harm category.
1089
+ * @public
1090
+ */
1091
+ export declare type HarmProbability = (typeof HarmProbability)[keyof typeof HarmProbability];
961
1092
 
962
1093
  /**
963
1094
  * Harm severity levels.
964
1095
  * @public
965
1096
  */
966
- export declare enum HarmSeverity {
1097
+ export declare const HarmSeverity: {
967
1098
  /**
968
1099
  * Negligible level of harm severity.
969
1100
  */
970
- HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE",
1101
+ readonly HARM_SEVERITY_NEGLIGIBLE: "HARM_SEVERITY_NEGLIGIBLE";
971
1102
  /**
972
1103
  * Low level of harm severity.
973
1104
  */
974
- HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW",
1105
+ readonly HARM_SEVERITY_LOW: "HARM_SEVERITY_LOW";
975
1106
  /**
976
1107
  * Medium level of harm severity.
977
1108
  */
978
- HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM",
1109
+ readonly HARM_SEVERITY_MEDIUM: "HARM_SEVERITY_MEDIUM";
979
1110
  /**
980
1111
  * High level of harm severity.
981
1112
  */
982
- HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH",
1113
+ readonly HARM_SEVERITY_HIGH: "HARM_SEVERITY_HIGH";
983
1114
  /**
984
1115
  * Harm severity is not supported.
985
1116
  *
986
1117
  * @remarks
987
1118
  * The GoogleAI backend does not support `HarmSeverity`, so this value is used as a fallback.
988
1119
  */
989
- HARM_SEVERITY_UNSUPPORTED = "HARM_SEVERITY_UNSUPPORTED"
990
- }
1120
+ readonly HARM_SEVERITY_UNSUPPORTED: "HARM_SEVERITY_UNSUPPORTED";
1121
+ };
1122
+
1123
+ /**
1124
+ * Harm severity levels.
1125
+ * @public
1126
+ */
1127
+ export declare type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity];
991
1128
 
992
1129
  /**
993
1130
  * Aspect ratios for Imagen images.
@@ -1000,28 +1137,41 @@ export declare enum HarmSeverity {
1000
1137
  *
1001
1138
  * @beta
1002
1139
  */
1003
- export declare enum ImagenAspectRatio {
1140
+ export declare const ImagenAspectRatio: {
1004
1141
  /**
1005
1142
  * Square (1:1) aspect ratio.
1006
1143
  */
1007
- SQUARE = "1:1",
1144
+ readonly SQUARE: "1:1";
1008
1145
  /**
1009
1146
  * Landscape (3:4) aspect ratio.
1010
1147
  */
1011
- LANDSCAPE_3x4 = "3:4",
1148
+ readonly LANDSCAPE_3x4: "3:4";
1012
1149
  /**
1013
1150
  * Portrait (4:3) aspect ratio.
1014
1151
  */
1015
- PORTRAIT_4x3 = "4:3",
1152
+ readonly PORTRAIT_4x3: "4:3";
1016
1153
  /**
1017
1154
  * Landscape (16:9) aspect ratio.
1018
1155
  */
1019
- LANDSCAPE_16x9 = "16:9",
1156
+ readonly LANDSCAPE_16x9: "16:9";
1020
1157
  /**
1021
1158
  * Portrait (9:16) aspect ratio.
1022
1159
  */
1023
- PORTRAIT_9x16 = "9:16"
1024
- }
1160
+ readonly PORTRAIT_9x16: "9:16";
1161
+ };
1162
+
1163
+ /**
1164
+ * Aspect ratios for Imagen images.
1165
+ *
1166
+ * To specify an aspect ratio for generated images, set the `aspectRatio` property in your
1167
+ * {@link ImagenGenerationConfig}.
1168
+ *
1169
+ * See the the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation }
1170
+ * for more details and examples of the supported aspect ratios.
1171
+ *
1172
+ * @beta
1173
+ */
1174
+ export declare type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio];
1025
1175
 
1026
1176
  /**
1027
1177
  * An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.
@@ -1073,7 +1223,7 @@ export declare interface ImagenGenerationConfig {
1073
1223
  numberOfImages?: number;
1074
1224
  /**
1075
1225
  * The aspect ratio of the generated images. The default value is square 1:1.
1076
- * Supported aspect ratios depend on the Imagen model, see {@link ImagenAspectRatio}
1226
+ * Supported aspect ratios depend on the Imagen model, see {@link (ImagenAspectRatio:type)}
1077
1227
  * for more details.
1078
1228
  */
1079
1229
  aspectRatio?: ImagenAspectRatio;
@@ -1115,8 +1265,8 @@ export declare interface ImagenGenerationResponse<T extends ImagenInlineImage |
1115
1265
  * The reason that images were filtered out. This property will only be defined if one
1116
1266
  * or more images were filtered.
1117
1267
  *
1118
- * Images may be filtered out due to the {@link ImagenSafetyFilterLevel},
1119
- * {@link ImagenPersonFilterLevel}, or filtering included in the model.
1268
+ * Images may be filtered out due to the {@link (ImagenSafetyFilterLevel:type)},
1269
+ * {@link (ImagenPersonFilterLevel:type)}, or filtering included in the model.
1120
1270
  * The filter levels may be adjusted in your {@link ImagenSafetySettings}.
1121
1271
  *
1122
1272
  * See the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen | Responsible AI and usage guidelines for Imagen}
@@ -1320,11 +1470,11 @@ export declare interface ImagenModelParams {
1320
1470
  *
1321
1471
  * @beta
1322
1472
  */
1323
- export declare enum ImagenPersonFilterLevel {
1473
+ export declare const ImagenPersonFilterLevel: {
1324
1474
  /**
1325
1475
  * Disallow generation of images containing people or faces; images of people are filtered out.
1326
1476
  */
1327
- BLOCK_ALL = "dont_allow",
1477
+ readonly BLOCK_ALL: "dont_allow";
1328
1478
  /**
1329
1479
  * Allow generation of images containing adults only; images of children are filtered out.
1330
1480
  *
@@ -1332,7 +1482,7 @@ export declare enum ImagenPersonFilterLevel {
1332
1482
  * 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}
1333
1483
  * for more details.
1334
1484
  */
1335
- ALLOW_ADULT = "allow_adult",
1485
+ readonly ALLOW_ADULT: "allow_adult";
1336
1486
  /**
1337
1487
  * Allow generation of images containing adults only; images of children are filtered out.
1338
1488
  *
@@ -1340,8 +1490,18 @@ export declare enum ImagenPersonFilterLevel {
1340
1490
  * 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}
1341
1491
  * for more details.
1342
1492
  */
1343
- ALLOW_ALL = "allow_all"
1344
- }
1493
+ readonly ALLOW_ALL: "allow_all";
1494
+ };
1495
+
1496
+ /**
1497
+ * A filter level controlling whether generation of images containing people or faces is allowed.
1498
+ *
1499
+ * See the <a href="http://firebase.google.com/docs/vertex-ai/generate-images">personGeneration</a>
1500
+ * documentation for more details.
1501
+ *
1502
+ * @beta
1503
+ */
1504
+ export declare type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel];
1345
1505
 
1346
1506
  /**
1347
1507
  * A filter level controlling how aggressively to filter sensitive content.
@@ -1355,27 +1515,41 @@ export declare enum ImagenPersonFilterLevel {
1355
1515
  *
1356
1516
  * @beta
1357
1517
  */
1358
- export declare enum ImagenSafetyFilterLevel {
1518
+ export declare const ImagenSafetyFilterLevel: {
1359
1519
  /**
1360
1520
  * The most aggressive filtering level; most strict blocking.
1361
1521
  */
1362
- BLOCK_LOW_AND_ABOVE = "block_low_and_above",
1522
+ readonly BLOCK_LOW_AND_ABOVE: "block_low_and_above";
1363
1523
  /**
1364
1524
  * Blocks some sensitive prompts and responses.
1365
1525
  */
1366
- BLOCK_MEDIUM_AND_ABOVE = "block_medium_and_above",
1526
+ readonly BLOCK_MEDIUM_AND_ABOVE: "block_medium_and_above";
1367
1527
  /**
1368
1528
  * Blocks few sensitive prompts and responses.
1369
1529
  */
1370
- BLOCK_ONLY_HIGH = "block_only_high",
1530
+ readonly BLOCK_ONLY_HIGH: "block_only_high";
1371
1531
  /**
1372
1532
  * The least aggressive filtering level; blocks very few sensitive prompts and responses.
1373
1533
  *
1374
1534
  * Access to this feature is restricted and may require your case to be reviewed and approved by
1375
1535
  * Cloud support.
1376
1536
  */
1377
- BLOCK_NONE = "block_none"
1378
- }
1537
+ readonly BLOCK_NONE: "block_none";
1538
+ };
1539
+
1540
+ /**
1541
+ * A filter level controlling how aggressively to filter sensitive content.
1542
+ *
1543
+ * Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI
1544
+ * are assessed against a list of safety filters, which include 'harmful categories' (for example,
1545
+ * `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to
1546
+ * filter out potentially harmful content from responses. See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation }
1547
+ * and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines}
1548
+ * for more details.
1549
+ *
1550
+ * @beta
1551
+ */
1552
+ export declare type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel];
1379
1553
 
1380
1554
  /**
1381
1555
  * Settings for controlling the aggressiveness of filtering out sensitive content.
@@ -1424,32 +1598,38 @@ export declare class IntegerSchema extends Schema {
1424
1598
  * Content part modality.
1425
1599
  * @public
1426
1600
  */
1427
- export declare enum Modality {
1601
+ export declare const Modality: {
1428
1602
  /**
1429
1603
  * Unspecified modality.
1430
1604
  */
1431
- MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED",
1605
+ readonly MODALITY_UNSPECIFIED: "MODALITY_UNSPECIFIED";
1432
1606
  /**
1433
1607
  * Plain text.
1434
1608
  */
1435
- TEXT = "TEXT",
1609
+ readonly TEXT: "TEXT";
1436
1610
  /**
1437
1611
  * Image.
1438
1612
  */
1439
- IMAGE = "IMAGE",
1613
+ readonly IMAGE: "IMAGE";
1440
1614
  /**
1441
1615
  * Video.
1442
1616
  */
1443
- VIDEO = "VIDEO",
1617
+ readonly VIDEO: "VIDEO";
1444
1618
  /**
1445
1619
  * Audio.
1446
1620
  */
1447
- AUDIO = "AUDIO",
1621
+ readonly AUDIO: "AUDIO";
1448
1622
  /**
1449
1623
  * Document (for example, PDF).
1450
1624
  */
1451
- DOCUMENT = "DOCUMENT"
1452
- }
1625
+ readonly DOCUMENT: "DOCUMENT";
1626
+ };
1627
+
1628
+ /**
1629
+ * Content part modality.
1630
+ * @public
1631
+ */
1632
+ export declare type Modality = (typeof Modality)[keyof typeof Modality];
1453
1633
 
1454
1634
  /**
1455
1635
  * Represents token counting info for a single modality.
@@ -1499,12 +1679,20 @@ export declare class ObjectSchema extends Schema {
1499
1679
  }
1500
1680
 
1501
1681
  /**
1502
- * Interface for {@link ObjectSchema} class.
1682
+ * Interface for JSON parameters in a schema of {@link SchemaType}
1683
+ * "object" when not using the `Schema.object()` helper.
1503
1684
  * @public
1504
1685
  */
1505
- export declare interface ObjectSchemaInterface extends SchemaInterface {
1506
- type: SchemaType.OBJECT;
1507
- optionalProperties?: string[];
1686
+ export declare interface ObjectSchemaRequest extends SchemaRequest {
1687
+ type: 'object';
1688
+ /**
1689
+ * This is not a property accepted in the final request to the backend, but is
1690
+ * a client-side convenience property that is only usable by constructing
1691
+ * a schema through the `Schema.object()` helper method. Populating this
1692
+ * property will cause response errors if the object is not wrapped with
1693
+ * `Schema.object()`.
1694
+ */
1695
+ optionalProperties?: never;
1508
1696
  }
1509
1697
 
1510
1698
  /**
@@ -1663,10 +1851,11 @@ export declare interface SafetySetting {
1663
1851
  */
1664
1852
  export declare abstract class Schema implements SchemaInterface {
1665
1853
  /**
1666
- * Optional. The type of the property. {@link
1667
- * SchemaType}.
1854
+ * Optional. The type of the property.
1855
+ * This can only be undefined when using `anyOf` schemas, which do not have an
1856
+ * explicit type in the {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type | OpenAPI specification}.
1668
1857
  */
1669
- type: SchemaType;
1858
+ type?: SchemaType;
1670
1859
  /** Optional. The format of the property.
1671
1860
  * Supported formats:<br/>
1672
1861
  * <ul>
@@ -1680,9 +1869,9 @@ export declare abstract class Schema implements SchemaInterface {
1680
1869
  description?: string;
1681
1870
  /** Optional. The items of the property. */
1682
1871
  items?: SchemaInterface;
1683
- /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1872
+ /** The minimum number of items (elements) in a schema of {@link (SchemaType:type)} `array`. */
1684
1873
  minItems?: number;
1685
- /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1874
+ /** The maximum number of items (elements) in a schema of {@link (SchemaType:type)} `array`. */
1686
1875
  maxItems?: number;
1687
1876
  /** Optional. Whether the property is nullable. Defaults to false. */
1688
1877
  nullable: boolean;
@@ -1711,6 +1900,9 @@ export declare abstract class Schema implements SchemaInterface {
1711
1900
  static integer(integerParams?: SchemaParams): IntegerSchema;
1712
1901
  static number(numberParams?: SchemaParams): NumberSchema;
1713
1902
  static boolean(booleanParams?: SchemaParams): BooleanSchema;
1903
+ static anyOf(anyOfParams: SchemaParams & {
1904
+ anyOf: TypedSchema[];
1905
+ }): AnyOfSchema;
1714
1906
  }
1715
1907
 
1716
1908
  /**
@@ -1719,10 +1911,10 @@ export declare abstract class Schema implements SchemaInterface {
1719
1911
  */
1720
1912
  export declare interface SchemaInterface extends SchemaShared<SchemaInterface> {
1721
1913
  /**
1722
- * The type of the property. {@link
1723
- * SchemaType}.
1914
+ * The type of the property. this can only be undefined when using `anyof` schemas,
1915
+ * 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}.
1724
1916
  */
1725
- type: SchemaType;
1917
+ type?: SchemaType;
1726
1918
  }
1727
1919
 
1728
1920
  /**
@@ -1739,10 +1931,10 @@ export declare interface SchemaParams extends SchemaShared<SchemaInterface> {
1739
1931
  */
1740
1932
  export declare interface SchemaRequest extends SchemaShared<SchemaRequest> {
1741
1933
  /**
1742
- * The type of the property. {@link
1743
- * SchemaType}.
1934
+ * The type of the property. this can only be undefined when using `anyOf` schemas,
1935
+ * 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 }.
1744
1936
  */
1745
- type: SchemaType;
1937
+ type?: SchemaType;
1746
1938
  /** Optional. Array of required property. */
1747
1939
  required?: string[];
1748
1940
  }
@@ -1753,6 +1945,12 @@ export declare interface SchemaRequest extends SchemaShared<SchemaRequest> {
1753
1945
  * @public
1754
1946
  */
1755
1947
  export declare interface SchemaShared<T> {
1948
+ /**
1949
+ * An array of {@link Schema}. The generated data must be valid against any of the schemas
1950
+ * listed in this array. This allows specifying multiple possible structures or types for a
1951
+ * single field.
1952
+ */
1953
+ anyOf?: T[];
1756
1954
  /** Optional. The format of the property.
1757
1955
  * When using the Gemini Developer API ({@link GoogleAIBackend}), this must be either `'enum'` or
1758
1956
  * `'date-time'`, otherwise requests will fail.
@@ -1768,9 +1966,9 @@ export declare interface SchemaShared<T> {
1768
1966
  title?: string;
1769
1967
  /** Optional. The items of the property. */
1770
1968
  items?: T;
1771
- /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1969
+ /** The minimum number of items (elements) in a schema of {@link (SchemaType:type)} `array`. */
1772
1970
  minItems?: number;
1773
- /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
1971
+ /** The maximum number of items (elements) in a schema of {@link (SchemaType:type)} `array`. */
1774
1972
  maxItems?: number;
1775
1973
  /** Optional. Map of `Schema` objects. */
1776
1974
  properties?: {
@@ -1791,50 +1989,88 @@ export declare interface SchemaShared<T> {
1791
1989
  [key: string]: unknown;
1792
1990
  }
1793
1991
 
1794
- /**
1795
- * @license
1796
- * Copyright 2024 Google LLC
1797
- *
1798
- * Licensed under the Apache License, Version 2.0 (the "License");
1799
- * you may not use this file except in compliance with the License.
1800
- * You may obtain a copy of the License at
1801
- *
1802
- * http://www.apache.org/licenses/LICENSE-2.0
1803
- *
1804
- * Unless required by applicable law or agreed to in writing, software
1805
- * distributed under the License is distributed on an "AS IS" BASIS,
1806
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1807
- * See the License for the specific language governing permissions and
1808
- * limitations under the License.
1809
- */
1810
1992
  /**
1811
1993
  * Contains the list of OpenAPI data types
1812
1994
  * as defined by the
1813
1995
  * {@link https://swagger.io/docs/specification/data-models/data-types/ | OpenAPI specification}
1814
1996
  * @public
1815
1997
  */
1816
- export declare enum SchemaType {
1998
+ export declare const SchemaType: {
1817
1999
  /** String type. */
1818
- STRING = "string",
2000
+ readonly STRING: "string";
1819
2001
  /** Number type. */
1820
- NUMBER = "number",
2002
+ readonly NUMBER: "number";
1821
2003
  /** Integer type. */
1822
- INTEGER = "integer",
2004
+ readonly INTEGER: "integer";
1823
2005
  /** Boolean type. */
1824
- BOOLEAN = "boolean",
2006
+ readonly BOOLEAN: "boolean";
1825
2007
  /** Array type. */
1826
- ARRAY = "array",
2008
+ readonly ARRAY: "array";
1827
2009
  /** Object type. */
1828
- OBJECT = "object"
2010
+ readonly OBJECT: "object";
2011
+ };
2012
+
2013
+ /**
2014
+ * Contains the list of OpenAPI data types
2015
+ * as defined by the
2016
+ * {@link https://swagger.io/docs/specification/data-models/data-types/ | OpenAPI specification}
2017
+ * @public
2018
+ */
2019
+ export declare type SchemaType = (typeof SchemaType)[keyof typeof SchemaType];
2020
+
2021
+ /**
2022
+ * Google search entry point.
2023
+ *
2024
+ * @public
2025
+ */
2026
+ export declare interface SearchEntrypoint {
2027
+ /**
2028
+ * HTML/CSS snippet that must be embedded in a web page. The snippet is designed to avoid
2029
+ * undesired interaction with the rest of the page's CSS.
2030
+ *
2031
+ * To ensure proper rendering and prevent CSS conflicts, it is recommended
2032
+ * to encapsulate this `renderedContent` within a shadow DOM when embedding it
2033
+ * into a webpage. See {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM | MDN: Using shadow DOM}.
2034
+ *
2035
+ * @example
2036
+ * ```javascript
2037
+ * const container = document.createElement('div');
2038
+ * document.body.appendChild(container);
2039
+ * container.attachShadow({ mode: 'open' }).innerHTML = renderedContent;
2040
+ * ```
2041
+ */
2042
+ renderedContent?: string;
1829
2043
  }
1830
2044
 
1831
2045
  /**
2046
+ * Represents a specific segment within a {@link Content} object, often used to
2047
+ * pinpoint the exact location of text or data that grounding information refers to.
2048
+ *
1832
2049
  * @public
1833
2050
  */
1834
2051
  export declare interface Segment {
2052
+ /**
2053
+ * The zero-based index of the {@link Part} object within the `parts` array
2054
+ * of its parent {@link Content} object. This identifies which part of the
2055
+ * content the segment belongs to.
2056
+ */
1835
2057
  partIndex: number;
2058
+ /**
2059
+ * The zero-based start index of the segment within the specified `Part`,
2060
+ * measured in UTF-8 bytes. This offset is inclusive, starting from 0 at the
2061
+ * beginning of the part's content (e.g., `Part.text`).
2062
+ */
1836
2063
  startIndex: number;
2064
+ /**
2065
+ * The zero-based end index of the segment within the specified `Part`,
2066
+ * measured in UTF-8 bytes. This offset is exclusive, meaning the character
2067
+ * at this index is not included in the segment.
2068
+ */
1837
2069
  endIndex: number;
2070
+ /**
2071
+ * The text corresponding to the segment from the response.
2072
+ */
2073
+ text: string;
1838
2074
  }
1839
2075
 
1840
2076
  /**
@@ -1870,11 +2106,36 @@ export declare interface TextPart {
1870
2106
  functionResponse?: never;
1871
2107
  }
1872
2108
 
2109
+ /**
2110
+ * Configuration for "thinking" behavior of compatible Gemini models.
2111
+ *
2112
+ * Certain models utilize a thinking process before generating a response. This allows them to
2113
+ * reason through complex problems and plan a more coherent and accurate answer.
2114
+ *
2115
+ * @public
2116
+ */
2117
+ export declare interface ThinkingConfig {
2118
+ /**
2119
+ * The thinking budget, in tokens.
2120
+ *
2121
+ * This parameter sets an upper limit on the number of tokens the model can use for its internal
2122
+ * "thinking" process. A higher budget may result in higher quality responses for complex tasks
2123
+ * but can also increase latency and cost.
2124
+ *
2125
+ * If you don't specify a budget, the model will determine the appropriate amount
2126
+ * of thinking based on the complexity of the prompt.
2127
+ *
2128
+ * An error will be thrown if you set a thinking budget for a model that does not support this
2129
+ * feature or if the specified budget is not within the model's supported range.
2130
+ */
2131
+ thinkingBudget?: number;
2132
+ }
2133
+
1873
2134
  /**
1874
2135
  * Defines a tool that model can call to access external knowledge.
1875
2136
  * @public
1876
2137
  */
1877
- export declare type Tool = FunctionDeclarationsTool;
2138
+ export declare type Tool = FunctionDeclarationsTool | GoogleSearchTool;
1878
2139
 
1879
2140
  /**
1880
2141
  * Tool config. This config is shared for all tools provided in the request.
@@ -1888,7 +2149,7 @@ export declare interface ToolConfig {
1888
2149
  * A type that includes all specific Schema types.
1889
2150
  * @public
1890
2151
  */
1891
- export declare type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema;
2152
+ export declare type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema | AnyOfSchema;
1892
2153
 
1893
2154
  /**
1894
2155
  * Usage metadata about a {@link GenerateContentResponse}.
@@ -1898,22 +2159,15 @@ export declare type TypedSchema = IntegerSchema | NumberSchema | StringSchema |
1898
2159
  export declare interface UsageMetadata {
1899
2160
  promptTokenCount: number;
1900
2161
  candidatesTokenCount: number;
2162
+ /**
2163
+ * The number of tokens used by the model's internal "thinking" process.
2164
+ */
2165
+ thoughtsTokenCount?: number;
1901
2166
  totalTokenCount: number;
1902
2167
  promptTokensDetails?: ModalityTokenCount[];
1903
2168
  candidatesTokensDetails?: ModalityTokenCount[];
1904
2169
  }
1905
2170
 
1906
- /**
1907
- * @deprecated Use the new {@link AI | AI} instead. The Vertex AI in Firebase SDK has been
1908
- * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
1909
- * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
1910
- *
1911
- * An instance of the Firebase AI SDK.
1912
- *
1913
- * @public
1914
- */
1915
- export declare type VertexAI = AI;
1916
-
1917
2171
  /**
1918
2172
  * Configuration class for the Vertex AI Gemini API.
1919
2173
  *
@@ -1939,37 +2193,6 @@ export declare class VertexAIBackend extends Backend {
1939
2193
  constructor(location?: string);
1940
2194
  }
1941
2195
 
1942
- /**
1943
- * @deprecated Use the new {@link AIError} instead. The Vertex AI in Firebase SDK has been
1944
- * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
1945
- * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
1946
- *
1947
- * Error class for the Firebase AI SDK.
1948
- *
1949
- * @public
1950
- */
1951
- export declare const VertexAIError: typeof AIError;
1952
-
1953
- /**
1954
- * @deprecated Use the new {@link AIModel} instead. The Vertex AI in Firebase SDK has been
1955
- * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
1956
- * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
1957
- *
1958
- * Base class for Firebase AI model APIs.
1959
- *
1960
- * @public
1961
- */
1962
- export declare const VertexAIModel: typeof AIModel;
1963
-
1964
- /**
1965
- * Options when initializing the Firebase AI SDK.
1966
- *
1967
- * @public
1968
- */
1969
- export declare interface VertexAIOptions {
1970
- location?: string;
1971
- }
1972
-
1973
2196
  /**
1974
2197
  * Describes the input video content.
1975
2198
  * @public
@@ -1995,4 +2218,31 @@ export declare interface WebAttribution {
1995
2218
  title: string;
1996
2219
  }
1997
2220
 
2221
+ /**
2222
+ * A grounding chunk from the web.
2223
+ *
2224
+ * Important: If using Grounding with Google Search, you are required to comply with the
2225
+ * {@link https://cloud.google.com/terms/service-terms | Service Specific Terms} for "Grounding with Google Search".
2226
+ *
2227
+ * @public
2228
+ */
2229
+ export declare interface WebGroundingChunk {
2230
+ /**
2231
+ * The URI of the retrieved web page.
2232
+ */
2233
+ uri?: string;
2234
+ /**
2235
+ * The title of the retrieved web page.
2236
+ */
2237
+ title?: string;
2238
+ /**
2239
+ * The domain of the original URI from which the content was retrieved.
2240
+ *
2241
+ * This property is only supported in the Vertex AI Gemini API ({@link VertexAIBackend}).
2242
+ * When using the Gemini Developer API ({@link GoogleAIBackend}), this property will be
2243
+ * `undefined`.
2244
+ */
2245
+ domain?: string;
2246
+ }
2247
+
1998
2248
  export { }