44
55``` ts
66
7+ import { AppCheckInternalComponentName } from ' @firebase/app-check-interop-types' ;
78import { AppCheckTokenResult } from ' @firebase/app-check-interop-types' ;
9+ import { ComponentContainer } from ' @firebase/component' ;
810import { FirebaseApp } from ' @firebase/app' ;
11+ import { FirebaseAppCheckInternal } from ' @firebase/app-check-interop-types' ;
12+ import { FirebaseAuthInternal } from ' @firebase/auth-interop-types' ;
13+ import { FirebaseAuthInternalName } from ' @firebase/auth-interop-types' ;
914import { FirebaseAuthTokenData } from ' @firebase/auth-interop-types' ;
1015import { FirebaseError } from ' @firebase/util' ;
16+ import { _FirebaseService } from ' @firebase/app' ;
17+ import { InstanceFactoryOptions } from ' @firebase/component' ;
18+ import { Provider } from ' @firebase/component' ;
1119
1220// @public
1321export interface AI {
1422 app: FirebaseApp ;
1523 backend: Backend ;
1624 // @deprecated (undocumented)
1725 location: string ;
26+ options? : AIOptions ;
1827}
1928
2029// @public
@@ -54,15 +63,16 @@ export abstract class AIModel {
5463 // Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts
5564 //
5665 // @internal (undocumented)
57- protected _apiSettings: ApiSettings ;
66+ _apiSettings: ApiSettings ;
5867 readonly model: string ;
5968 // @internal
6069 static normalizeModelName(modelName : string , backendType : BackendType ): string ;
6170 }
6271
6372// @public
6473export interface AIOptions {
65- backend: Backend ;
74+ backend? : Backend ;
75+ useLimitedUseAppCheckTokens? : boolean ;
6676}
6777
6878// @public
@@ -131,7 +141,7 @@ export class BooleanSchema extends Schema {
131141
132142// @public
133143export class ChatSession {
134- constructor (apiSettings : ApiSettings , model : string , params ? : StartChatParams | undefined , requestOptions ? : RequestOptions | undefined );
144+ constructor (apiSettings : ApiSettings , model : string , chromeAdapter ? : ChromeAdapter | undefined , params ? : StartChatParams | undefined , requestOptions ? : RequestOptions | undefined );
135145 getHistory(): Promise <Content []>;
136146 // (undocumented)
137147 model: string ;
@@ -143,6 +153,15 @@ export class ChatSession {
143153 sendMessageStream(request : string | Array <string | Part >): Promise <GenerateContentStreamResult >;
144154 }
145155
156+ // @public
157+ export interface ChromeAdapter {
158+ // @internal (undocumented)
159+ countTokens(request : CountTokensRequest ): Promise <Response >;
160+ generateContent(request : GenerateContentRequest ): Promise <Response >;
161+ generateContentStream(request : GenerateContentRequest ): Promise <Response >;
162+ isAvailable(request : GenerateContentRequest ): Promise <boolean >;
163+ }
164+
146165// @public
147166export interface Citation {
148167 // (undocumented)
@@ -210,10 +229,10 @@ export { Date_2 as Date }
210229
211230// @public
212231export interface EnhancedGenerateContentResponse extends GenerateContentResponse {
213- // (undocumented)
214232 functionCalls: () => FunctionCall [] | undefined ;
215233 inlineDataParts: () => InlineDataPart [] | undefined ;
216234 text: () => string ;
235+ thoughtSummary: () => string | undefined ;
217236}
218237
219238// @public
@@ -226,6 +245,11 @@ export interface ErrorDetails {
226245 reason? : string ;
227246}
228247
248+ // Warning: (ae-forgotten-export) The symbol "AIService" needs to be exported by the entry point index.d.ts
249+ //
250+ // @public (undocumented)
251+ export function factory(container : ComponentContainer , { instanceIdentifier }: InstanceFactoryOptions ): AIService ;
252+
229253// @public
230254export interface FileData {
231255 // (undocumented)
@@ -246,6 +270,10 @@ export interface FileDataPart {
246270 inlineData? : never ;
247271 // (undocumented)
248272 text? : never ;
273+ // (undocumented)
274+ thought? : boolean ;
275+ // @internal (undocumented)
276+ thoughtSignature? : never ;
249277}
250278
251279// @public
@@ -301,6 +329,10 @@ export interface FunctionCallPart {
301329 inlineData? : never ;
302330 // (undocumented)
303331 text? : never ;
332+ // (undocumented)
333+ thought? : boolean ;
334+ // @internal (undocumented)
335+ thoughtSignature? : never ;
304336}
305337
306338// @public
@@ -334,6 +366,10 @@ export interface FunctionResponsePart {
334366 inlineData? : never ;
335367 // (undocumented)
336368 text? : never ;
369+ // (undocumented)
370+ thought? : boolean ;
371+ // @internal (undocumented)
372+ thoughtSignature? : never ;
337373}
338374
339375// @public
@@ -424,7 +460,7 @@ export interface GenerativeContentBlob {
424460
425461// @public
426462export class GenerativeModel extends AIModel {
427- constructor (ai : AI , modelParams : ModelParams , requestOptions ? : RequestOptions );
463+ constructor (ai : AI , modelParams : ModelParams , requestOptions ? : RequestOptions , chromeAdapter ? : ChromeAdapter | undefined );
428464 countTokens(request : CountTokensRequest | string | Array <string | Part >): Promise <CountTokensResponse >;
429465 generateContent(request : GenerateContentRequest | string | Array <string | Part >): Promise <GenerateContentResult >;
430466 generateContentStream(request : GenerateContentRequest | string | Array <string | Part >): Promise <GenerateContentStreamResult >;
@@ -447,7 +483,7 @@ export class GenerativeModel extends AIModel {
447483export function getAI(app ? : FirebaseApp , options ? : AIOptions ): AI ;
448484
449485// @public
450- export function getGenerativeModel(ai : AI , modelParams : ModelParams , requestOptions ? : RequestOptions ): GenerativeModel ;
486+ export function getGenerativeModel(ai : AI , modelParams : ModelParams | HybridParams , requestOptions ? : RequestOptions ): GenerativeModel ;
451487
452488// @beta
453489export function getImagenModel(ai : AI , modelParams : ImagenModelParams , requestOptions ? : RequestOptions ): ImagenModel ;
@@ -599,6 +635,13 @@ export const HarmSeverity: {
599635// @public
600636export type HarmSeverity = (typeof HarmSeverity )[keyof typeof HarmSeverity ];
601637
638+ // @public
639+ export interface HybridParams {
640+ inCloudParams? : ModelParams ;
641+ mode: InferenceMode ;
642+ onDeviceParams? : OnDeviceParams ;
643+ }
644+
602645// @beta
603646export const ImagenAspectRatio: {
604647 readonly SQUARE: " 1:1" ;
@@ -611,7 +654,7 @@ export const ImagenAspectRatio: {
611654// @beta
612655export type ImagenAspectRatio = (typeof ImagenAspectRatio )[keyof typeof ImagenAspectRatio ];
613656
614- // @public
657+ // @beta
615658export interface ImagenGCSImage {
616659 gcsURI: string ;
617660 mimeType: string ;
@@ -692,6 +735,16 @@ export interface ImagenSafetySettings {
692735 safetyFilterLevel? : ImagenSafetyFilterLevel ;
693736}
694737
738+ // @public
739+ export const InferenceMode: {
740+ readonly PREFER_ON_DEVICE: " prefer_on_device" ;
741+ readonly ONLY_ON_DEVICE: " only_on_device" ;
742+ readonly ONLY_IN_CLOUD: " only_in_cloud" ;
743+ };
744+
745+ // @public
746+ export type InferenceMode = (typeof InferenceMode )[keyof typeof InferenceMode ];
747+
695748// @public
696749export interface InlineDataPart {
697750 // (undocumented)
@@ -702,6 +755,10 @@ export interface InlineDataPart {
702755 inlineData: GenerativeContentBlob ;
703756 // (undocumented)
704757 text? : never ;
758+ // (undocumented)
759+ thought? : boolean ;
760+ // @internal (undocumented)
761+ thoughtSignature? : never ;
705762 videoMetadata? : VideoMetadata ;
706763}
707764
@@ -710,6 +767,63 @@ export class IntegerSchema extends Schema {
710767 constructor (schemaParams ? : SchemaParams );
711768}
712769
770+ // @public
771+ export interface LanguageModelCreateCoreOptions {
772+ // (undocumented)
773+ expectedInputs? : LanguageModelExpected [];
774+ // (undocumented)
775+ temperature? : number ;
776+ // (undocumented)
777+ topK? : number ;
778+ }
779+
780+ // @public
781+ export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptions {
782+ // (undocumented)
783+ initialPrompts? : LanguageModelMessage [];
784+ // (undocumented)
785+ signal? : AbortSignal ;
786+ }
787+
788+ // @public
789+ export interface LanguageModelExpected {
790+ // (undocumented)
791+ languages? : string [];
792+ // (undocumented)
793+ type: LanguageModelMessageType ;
794+ }
795+
796+ // @public
797+ export interface LanguageModelMessage {
798+ // (undocumented)
799+ content: LanguageModelMessageContent [];
800+ // (undocumented)
801+ role: LanguageModelMessageRole ;
802+ }
803+
804+ // @public
805+ export interface LanguageModelMessageContent {
806+ // (undocumented)
807+ type: LanguageModelMessageType ;
808+ // (undocumented)
809+ value: LanguageModelMessageContentValue ;
810+ }
811+
812+ // @public
813+ export type LanguageModelMessageContentValue = ImageBitmapSource | AudioBuffer | BufferSource | string ;
814+
815+ // @public
816+ export type LanguageModelMessageRole = ' system' | ' user' | ' assistant' ;
817+
818+ // @public
819+ export type LanguageModelMessageType = ' text' | ' image' | ' audio' ;
820+
821+ // @public
822+ export interface LanguageModelPromptOptions {
823+ // (undocumented)
824+ responseConstraint? : object ;
825+ }
826+
713827// @beta
714828export interface LiveGenerationConfig {
715829 frequencyPenalty? : number ;
@@ -858,6 +972,14 @@ export interface ObjectSchemaRequest extends SchemaRequest {
858972 type: ' object' ;
859973}
860974
975+ // @public
976+ export interface OnDeviceParams {
977+ // (undocumented)
978+ createOptions? : LanguageModelCreateOptions ;
979+ // (undocumented)
980+ promptOptions? : LanguageModelPromptOptions ;
981+ }
982+
861983// @public
862984export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart ;
863985
@@ -1077,10 +1199,15 @@ export interface TextPart {
10771199 inlineData? : never ;
10781200 // (undocumented)
10791201 text: string ;
1202+ // (undocumented)
1203+ thought? : boolean ;
1204+ // @internal (undocumented)
1205+ thoughtSignature? : string ;
10801206}
10811207
10821208// @public
10831209export interface ThinkingConfig {
1210+ includeThoughts? : boolean ;
10841211 thinkingBudget? : number ;
10851212}
10861213
0 commit comments