4
4
5
5
``` ts
6
6
7
+ import { AppCheckInternalComponentName } from ' @firebase/app-check-interop-types' ;
7
8
import { AppCheckTokenResult } from ' @firebase/app-check-interop-types' ;
9
+ import { ComponentContainer } from ' @firebase/component' ;
8
10
import { 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' ;
9
14
import { FirebaseAuthTokenData } from ' @firebase/auth-interop-types' ;
10
15
import { FirebaseError } from ' @firebase/util' ;
16
+ import { _FirebaseService } from ' @firebase/app' ;
17
+ import { InstanceFactoryOptions } from ' @firebase/component' ;
18
+ import { Provider } from ' @firebase/component' ;
11
19
12
20
// @public
13
21
export interface AI {
14
22
app: FirebaseApp ;
15
23
backend: Backend ;
16
24
// @deprecated (undocumented)
17
25
location: string ;
26
+ options? : AIOptions ;
18
27
}
19
28
20
29
// @public
@@ -54,15 +63,16 @@ export abstract class AIModel {
54
63
// Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts
55
64
//
56
65
// @internal (undocumented)
57
- protected _apiSettings: ApiSettings ;
66
+ _apiSettings: ApiSettings ;
58
67
readonly model: string ;
59
68
// @internal
60
69
static normalizeModelName(modelName : string , backendType : BackendType ): string ;
61
70
}
62
71
63
72
// @public
64
73
export interface AIOptions {
65
- backend: Backend ;
74
+ backend? : Backend ;
75
+ useLimitedUseAppCheckTokens? : boolean ;
66
76
}
67
77
68
78
// @public
@@ -131,7 +141,7 @@ export class BooleanSchema extends Schema {
131
141
132
142
// @public
133
143
export 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 );
135
145
getHistory(): Promise <Content []>;
136
146
// (undocumented)
137
147
model: string ;
@@ -143,6 +153,15 @@ export class ChatSession {
143
153
sendMessageStream(request : string | Array <string | Part >): Promise <GenerateContentStreamResult >;
144
154
}
145
155
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
+
146
165
// @public
147
166
export interface Citation {
148
167
// (undocumented)
@@ -210,10 +229,10 @@ export { Date_2 as Date }
210
229
211
230
// @public
212
231
export interface EnhancedGenerateContentResponse extends GenerateContentResponse {
213
- // (undocumented)
214
232
functionCalls: () => FunctionCall [] | undefined ;
215
233
inlineDataParts: () => InlineDataPart [] | undefined ;
216
234
text: () => string ;
235
+ thoughtSummary: () => string | undefined ;
217
236
}
218
237
219
238
// @public
@@ -226,6 +245,11 @@ export interface ErrorDetails {
226
245
reason? : string ;
227
246
}
228
247
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
+
229
253
// @public
230
254
export interface FileData {
231
255
// (undocumented)
@@ -246,6 +270,10 @@ export interface FileDataPart {
246
270
inlineData? : never ;
247
271
// (undocumented)
248
272
text? : never ;
273
+ // (undocumented)
274
+ thought? : boolean ;
275
+ // @internal (undocumented)
276
+ thoughtSignature? : never ;
249
277
}
250
278
251
279
// @public
@@ -301,6 +329,10 @@ export interface FunctionCallPart {
301
329
inlineData? : never ;
302
330
// (undocumented)
303
331
text? : never ;
332
+ // (undocumented)
333
+ thought? : boolean ;
334
+ // @internal (undocumented)
335
+ thoughtSignature? : never ;
304
336
}
305
337
306
338
// @public
@@ -334,6 +366,10 @@ export interface FunctionResponsePart {
334
366
inlineData? : never ;
335
367
// (undocumented)
336
368
text? : never ;
369
+ // (undocumented)
370
+ thought? : boolean ;
371
+ // @internal (undocumented)
372
+ thoughtSignature? : never ;
337
373
}
338
374
339
375
// @public
@@ -424,7 +460,7 @@ export interface GenerativeContentBlob {
424
460
425
461
// @public
426
462
export class GenerativeModel extends AIModel {
427
- constructor (ai : AI , modelParams : ModelParams , requestOptions ? : RequestOptions );
463
+ constructor (ai : AI , modelParams : ModelParams , requestOptions ? : RequestOptions , chromeAdapter ? : ChromeAdapter | undefined );
428
464
countTokens(request : CountTokensRequest | string | Array <string | Part >): Promise <CountTokensResponse >;
429
465
generateContent(request : GenerateContentRequest | string | Array <string | Part >): Promise <GenerateContentResult >;
430
466
generateContentStream(request : GenerateContentRequest | string | Array <string | Part >): Promise <GenerateContentStreamResult >;
@@ -447,7 +483,7 @@ export class GenerativeModel extends AIModel {
447
483
export function getAI(app ? : FirebaseApp , options ? : AIOptions ): AI ;
448
484
449
485
// @public
450
- export function getGenerativeModel(ai : AI , modelParams : ModelParams , requestOptions ? : RequestOptions ): GenerativeModel ;
486
+ export function getGenerativeModel(ai : AI , modelParams : ModelParams | HybridParams , requestOptions ? : RequestOptions ): GenerativeModel ;
451
487
452
488
// @beta
453
489
export function getImagenModel(ai : AI , modelParams : ImagenModelParams , requestOptions ? : RequestOptions ): ImagenModel ;
@@ -599,6 +635,13 @@ export const HarmSeverity: {
599
635
// @public
600
636
export type HarmSeverity = (typeof HarmSeverity )[keyof typeof HarmSeverity ];
601
637
638
+ // @public
639
+ export interface HybridParams {
640
+ inCloudParams? : ModelParams ;
641
+ mode: InferenceMode ;
642
+ onDeviceParams? : OnDeviceParams ;
643
+ }
644
+
602
645
// @beta
603
646
export const ImagenAspectRatio: {
604
647
readonly SQUARE: " 1:1" ;
@@ -611,7 +654,7 @@ export const ImagenAspectRatio: {
611
654
// @beta
612
655
export type ImagenAspectRatio = (typeof ImagenAspectRatio )[keyof typeof ImagenAspectRatio ];
613
656
614
- // @public
657
+ // @beta
615
658
export interface ImagenGCSImage {
616
659
gcsURI: string ;
617
660
mimeType: string ;
@@ -692,6 +735,16 @@ export interface ImagenSafetySettings {
692
735
safetyFilterLevel? : ImagenSafetyFilterLevel ;
693
736
}
694
737
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
+
695
748
// @public
696
749
export interface InlineDataPart {
697
750
// (undocumented)
@@ -702,6 +755,10 @@ export interface InlineDataPart {
702
755
inlineData: GenerativeContentBlob ;
703
756
// (undocumented)
704
757
text? : never ;
758
+ // (undocumented)
759
+ thought? : boolean ;
760
+ // @internal (undocumented)
761
+ thoughtSignature? : never ;
705
762
videoMetadata? : VideoMetadata ;
706
763
}
707
764
@@ -710,6 +767,63 @@ export class IntegerSchema extends Schema {
710
767
constructor (schemaParams ? : SchemaParams );
711
768
}
712
769
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
+
713
827
// @beta
714
828
export interface LiveGenerationConfig {
715
829
frequencyPenalty? : number ;
@@ -858,6 +972,14 @@ export interface ObjectSchemaRequest extends SchemaRequest {
858
972
type: ' object' ;
859
973
}
860
974
975
+ // @public
976
+ export interface OnDeviceParams {
977
+ // (undocumented)
978
+ createOptions? : LanguageModelCreateOptions ;
979
+ // (undocumented)
980
+ promptOptions? : LanguageModelPromptOptions ;
981
+ }
982
+
861
983
// @public
862
984
export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart ;
863
985
@@ -1077,10 +1199,15 @@ export interface TextPart {
1077
1199
inlineData? : never ;
1078
1200
// (undocumented)
1079
1201
text: string ;
1202
+ // (undocumented)
1203
+ thought? : boolean ;
1204
+ // @internal (undocumented)
1205
+ thoughtSignature? : string ;
1080
1206
}
1081
1207
1082
1208
// @public
1083
1209
export interface ThinkingConfig {
1210
+ includeThoughts? : boolean ;
1084
1211
thinkingBudget? : number ;
1085
1212
}
1086
1213
0 commit comments