Skip to content

Commit 37f9ef5

Browse files
Merge main into release
2 parents 4d834de + c123766 commit 37f9ef5

File tree

70 files changed

+4130
-228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+4130
-228
lines changed

.changeset/feat-prefer-in-cloud.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@firebase/ai": minor
3+
"firebase": minor
4+
---
5+
6+
Added a new `InferenceMode` option for the hybrid on-device capability: `prefer_in_cloud`. When this mode is selected, the SDK will attempt to use a cloud-hosted model first. If the call to the cloud-hosted model fails with a network-related error, the SDK will fall back to the on-device model, if it's available.

.changeset/heavy-teachers-enjoy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/ai': patch
3+
---
4+
5+
Refactor component registration.

.changeset/lemon-baboons-lick.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@firebase/remote-config': minor
3+
'firebase': minor
4+
'@firebase/remote-config-types': minor
5+
---
6+
7+
Added support for Realtime Remote Config for the web. This feature introduces a new `onConfigUpdate` API and allows web applications to receive near-instant configuration updates without requiring periodic polling.

.changeset/lucky-socks-roll.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/ai': minor
3+
'firebase': minor
4+
---
5+
6+
Added Code Execution feature.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/ai': patch
3+
---
4+
5+
Change documentation tags for hybrid inference from "EXPERIMENTAL" to "public preview".

.changeset/tiny-doors-talk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/webchannel-wrapper": patch
3+
"@firebase/firestore": patch
4+
---
5+
Increased the buffering-proxy detection timeout to minimize the false-positive rate. Updating WebChannel to ignore duplicate messages received from the server. Fix for https://github.com/firebase/firebase-js-sdk/issues/8250.

common/api-review/ai.api.md

Lines changed: 121 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export class BooleanSchema extends Schema {
133133

134134
// @public
135135
export class ChatSession {
136+
// Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "ChromeAdapter" which is marked as @beta
136137
constructor(apiSettings: ApiSettings, model: string, chromeAdapter?: ChromeAdapter | undefined, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined);
137138
getHistory(): Promise<Content[]>;
138139
// (undocumented)
@@ -145,7 +146,7 @@ export class ChatSession {
145146
sendMessageStream(request: string | Array<string | Part>): Promise<GenerateContentStreamResult>;
146147
}
147148

148-
// @public
149+
// @beta
149150
export interface ChromeAdapter {
150151
// @internal (undocumented)
151152
countTokens(request: CountTokensRequest): Promise<Response>;
@@ -174,6 +175,39 @@ export interface CitationMetadata {
174175
citations: Citation[];
175176
}
176177

178+
// @public
179+
export interface CodeExecutionResult {
180+
outcome?: Outcome;
181+
output?: string;
182+
}
183+
184+
// @public
185+
export interface CodeExecutionResultPart {
186+
// (undocumented)
187+
codeExecutionResult?: CodeExecutionResult;
188+
// (undocumented)
189+
executableCode?: never;
190+
// (undocumented)
191+
fileData: never;
192+
// (undocumented)
193+
functionCall?: never;
194+
// (undocumented)
195+
functionResponse?: never;
196+
// (undocumented)
197+
inlineData?: never;
198+
// (undocumented)
199+
text?: never;
200+
// (undocumented)
201+
thought?: never;
202+
// @internal (undocumented)
203+
thoughtSignature?: never;
204+
}
205+
206+
// @public
207+
export interface CodeExecutionTool {
208+
codeExecution: {};
209+
}
210+
177211
// @public
178212
export interface Content {
179213
// (undocumented)
@@ -237,6 +271,34 @@ export interface ErrorDetails {
237271
reason?: string;
238272
}
239273

274+
// @public
275+
export interface ExecutableCode {
276+
code?: string;
277+
language?: Language;
278+
}
279+
280+
// @public
281+
export interface ExecutableCodePart {
282+
// (undocumented)
283+
codeExecutionResult?: never;
284+
// (undocumented)
285+
executableCode?: ExecutableCode;
286+
// (undocumented)
287+
fileData: never;
288+
// (undocumented)
289+
functionCall?: never;
290+
// (undocumented)
291+
functionResponse?: never;
292+
// (undocumented)
293+
inlineData?: never;
294+
// (undocumented)
295+
text?: never;
296+
// (undocumented)
297+
thought?: never;
298+
// @internal (undocumented)
299+
thoughtSignature?: never;
300+
}
301+
240302
// @public
241303
export interface FileData {
242304
// (undocumented)
@@ -247,6 +309,10 @@ export interface FileData {
247309

248310
// @public
249311
export interface FileDataPart {
312+
// (undocumented)
313+
codeExecutionResult?: never;
314+
// (undocumented)
315+
executableCode?: never;
250316
// (undocumented)
251317
fileData: FileData;
252318
// (undocumented)
@@ -308,6 +374,10 @@ export type FunctionCallingMode = (typeof FunctionCallingMode)[keyof typeof Func
308374

309375
// @public
310376
export interface FunctionCallPart {
377+
// (undocumented)
378+
codeExecutionResult?: never;
379+
// (undocumented)
380+
executableCode?: never;
311381
// (undocumented)
312382
functionCall: FunctionCall;
313383
// (undocumented)
@@ -345,6 +415,10 @@ export interface FunctionResponse {
345415

346416
// @public
347417
export interface FunctionResponsePart {
418+
// (undocumented)
419+
codeExecutionResult?: never;
420+
// (undocumented)
421+
executableCode?: never;
348422
// (undocumented)
349423
functionCall?: never;
350424
// (undocumented)
@@ -447,6 +521,7 @@ export interface GenerativeContentBlob {
447521

448522
// @public
449523
export class GenerativeModel extends AIModel {
524+
// Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "ChromeAdapter" which is marked as @beta
450525
constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions, chromeAdapter?: ChromeAdapter | undefined);
451526
countTokens(request: CountTokensRequest | string | Array<string | Part>): Promise<CountTokensResponse>;
452527
generateContent(request: GenerateContentRequest | string | Array<string | Part>): Promise<GenerateContentResult>;
@@ -469,6 +544,8 @@ export class GenerativeModel extends AIModel {
469544
// @public
470545
export function getAI(app?: FirebaseApp, options?: AIOptions): AI;
471546

547+
// Warning: (ae-incompatible-release-tags) The symbol "getGenerativeModel" is marked as @public, but its signature references "HybridParams" which is marked as @beta
548+
//
472549
// @public
473550
export function getGenerativeModel(ai: AI, modelParams: ModelParams | HybridParams, requestOptions?: RequestOptions): GenerativeModel;
474551

@@ -622,7 +699,7 @@ export const HarmSeverity: {
622699
// @public
623700
export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity];
624701

625-
// @public
702+
// @beta
626703
export interface HybridParams {
627704
inCloudParams?: ModelParams;
628705
mode: InferenceMode;
@@ -722,18 +799,23 @@ export interface ImagenSafetySettings {
722799
safetyFilterLevel?: ImagenSafetyFilterLevel;
723800
}
724801

725-
// @public
802+
// @beta
726803
export const InferenceMode: {
727804
readonly PREFER_ON_DEVICE: "prefer_on_device";
728805
readonly ONLY_ON_DEVICE: "only_on_device";
729806
readonly ONLY_IN_CLOUD: "only_in_cloud";
807+
readonly PREFER_IN_CLOUD: "prefer_in_cloud";
730808
};
731809

732-
// @public
810+
// @beta
733811
export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode];
734812

735813
// @public
736814
export interface InlineDataPart {
815+
// (undocumented)
816+
codeExecutionResult?: never;
817+
// (undocumented)
818+
executableCode?: never;
737819
// (undocumented)
738820
functionCall?: never;
739821
// (undocumented)
@@ -755,6 +837,15 @@ export class IntegerSchema extends Schema {
755837
}
756838

757839
// @public
840+
export const Language: {
841+
UNSPECIFIED: string;
842+
PYTHON: string;
843+
};
844+
845+
// @public
846+
export type Language = (typeof Language)[keyof typeof Language];
847+
848+
// @beta
758849
export interface LanguageModelCreateCoreOptions {
759850
// (undocumented)
760851
expectedInputs?: LanguageModelExpected[];
@@ -764,48 +855,48 @@ export interface LanguageModelCreateCoreOptions {
764855
topK?: number;
765856
}
766857

767-
// @public
858+
// @beta
768859
export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptions {
769860
// (undocumented)
770861
initialPrompts?: LanguageModelMessage[];
771862
// (undocumented)
772863
signal?: AbortSignal;
773864
}
774865

775-
// @public
866+
// @beta
776867
export interface LanguageModelExpected {
777868
// (undocumented)
778869
languages?: string[];
779870
// (undocumented)
780871
type: LanguageModelMessageType;
781872
}
782873

783-
// @public
874+
// @beta
784875
export interface LanguageModelMessage {
785876
// (undocumented)
786877
content: LanguageModelMessageContent[];
787878
// (undocumented)
788879
role: LanguageModelMessageRole;
789880
}
790881

791-
// @public
882+
// @beta
792883
export interface LanguageModelMessageContent {
793884
// (undocumented)
794885
type: LanguageModelMessageType;
795886
// (undocumented)
796887
value: LanguageModelMessageContentValue;
797888
}
798889

799-
// @public
890+
// @beta
800891
export type LanguageModelMessageContentValue = ImageBitmapSource | AudioBuffer | BufferSource | string;
801892

802-
// @public
893+
// @beta
803894
export type LanguageModelMessageRole = 'system' | 'user' | 'assistant';
804895

805-
// @public
896+
// @beta
806897
export type LanguageModelMessageType = 'text' | 'image' | 'audio';
807898

808-
// @public
899+
// @beta
809900
export interface LanguageModelPromptOptions {
810901
// (undocumented)
811902
responseConstraint?: object;
@@ -959,7 +1050,7 @@ export interface ObjectSchemaRequest extends SchemaRequest {
9591050
type: 'object';
9601051
}
9611052

962-
// @public
1053+
// @beta
9631054
export interface OnDeviceParams {
9641055
// (undocumented)
9651056
createOptions?: LanguageModelCreateOptions;
@@ -968,7 +1059,18 @@ export interface OnDeviceParams {
9681059
}
9691060

9701061
// @public
971-
export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart;
1062+
export const Outcome: {
1063+
UNSPECIFIED: string;
1064+
OK: string;
1065+
FAILED: string;
1066+
DEADLINE_EXCEEDED: string;
1067+
};
1068+
1069+
// @public
1070+
export type Outcome = (typeof Outcome)[keyof typeof Outcome];
1071+
1072+
// @public
1073+
export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart | ExecutableCodePart | CodeExecutionResultPart;
9721074

9731075
// @public
9741076
export const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"];
@@ -1178,6 +1280,10 @@ export class StringSchema extends Schema {
11781280

11791281
// @public
11801282
export interface TextPart {
1283+
// (undocumented)
1284+
codeExecutionResult?: never;
1285+
// (undocumented)
1286+
executableCode?: never;
11811287
// (undocumented)
11821288
functionCall?: never;
11831289
// (undocumented)
@@ -1199,7 +1305,7 @@ export interface ThinkingConfig {
11991305
}
12001306

12011307
// @public
1202-
export type Tool = FunctionDeclarationsTool | GoogleSearchTool;
1308+
export type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool;
12031309

12041310
// @public
12051311
export interface ToolConfig {

common/api-review/remote-config.api.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,23 @@
55
```ts
66

77
import { FirebaseApp } from '@firebase/app';
8+
import { FirebaseError } from '@firebase/app';
89

910
// @public
1011
export function activate(remoteConfig: RemoteConfig): Promise<boolean>;
1112

13+
// @public
14+
export interface ConfigUpdate {
15+
getUpdatedKeys(): Set<string>;
16+
}
17+
18+
// @public
19+
export interface ConfigUpdateObserver {
20+
complete: () => void;
21+
error: (error: FirebaseError) => void;
22+
next: (configUpdate: ConfigUpdate) => void;
23+
}
24+
1225
// @public
1326
export interface CustomSignals {
1427
// (undocumented)
@@ -29,11 +42,15 @@ export interface FetchResponse {
2942
config?: FirebaseRemoteConfigObject;
3043
eTag?: string;
3144
status: number;
45+
templateVersion?: number;
3246
}
3347

3448
// @public
3549
export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle';
3650

51+
// @public
52+
export type FetchType = 'BASE' | 'REALTIME';
53+
3754
// @public
3855
export interface FirebaseRemoteConfigObject {
3956
// (undocumented)
@@ -64,6 +81,9 @@ export function isSupported(): Promise<boolean>;
6481
// @public
6582
export type LogLevel = 'debug' | 'error' | 'silent';
6683

84+
// @public
85+
export function onConfigUpdate(remoteConfig: RemoteConfig, observer: ConfigUpdateObserver): Unsubscribe;
86+
6787
// @public
6888
export interface RemoteConfig {
6989
app: FirebaseApp;
@@ -93,6 +113,9 @@ export function setCustomSignals(remoteConfig: RemoteConfig, customSignals: Cust
93113
// @public
94114
export function setLogLevel(remoteConfig: RemoteConfig, logLevel: LogLevel): void;
95115

116+
// @public
117+
export type Unsubscribe = () => void;
118+
96119
// @public
97120
export interface Value {
98121
asBoolean(): boolean;

0 commit comments

Comments
 (0)