Skip to content

Commit e397749

Browse files
Merge main into release
2 parents b7e18d0 + bc5a7c4 commit e397749

39 files changed

+974
-92
lines changed

.changeset/angry-apples-think.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/auth': patch
3+
---
4+
5+
Expose `browserCookiePersistence` beta feature in public typings.

.changeset/dull-ligers-bow.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'firebase': minor
3+
'@firebase/ai': minor
4+
---
5+
6+
Deprecate `sendMediaChunks()` and `sendMediaStream()`. Instead, use the new methods added to the `LiveSession` class.
7+
Add `sendTextRealtime()`, `sendAudioReatime()`, and `sendVideoRealtime()` to the `LiveSession` class.

.changeset/fast-rocks-sing.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'firebase': minor
3+
'@firebase/ai': minor
4+
---
5+
6+
Add support for audio transcriptions in the Live API.

.changeset/metal-lies-compete.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/auth': patch
3+
'firebase': patch
4+
---
5+
6+
Export MISSING_PASSWORD via AuthErrorCodes in @firebase/auth.

.changeset/rare-hats-know.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+
Fix logic for merging default `onDeviceParams` with user-provided `onDeviceParams`.

.changeset/smooth-parrots-speak.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+
Add `inferenceSource` to the response from `generateContent` and `generateContentStream`. This property indicates whether on-device or in-cloud inference was used to generate the result.

common/api-review/ai.api.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ export interface AudioConversationController {
9292
stop: () => Promise<void>;
9393
}
9494

95+
// @public
96+
export interface AudioTranscriptionConfig {
97+
}
98+
9599
// @public
96100
export abstract class Backend {
97101
protected constructor(type: BackendType);
@@ -256,6 +260,8 @@ export { Date_2 as Date }
256260
// @public
257261
export interface EnhancedGenerateContentResponse extends GenerateContentResponse {
258262
functionCalls: () => FunctionCall[] | undefined;
263+
// @beta
264+
inferenceSource?: InferenceSource;
259265
inlineDataParts: () => InlineDataPart[] | undefined;
260266
text: () => string;
261267
thoughtSummary: () => string | undefined;
@@ -816,6 +822,15 @@ export const InferenceMode: {
816822
// @beta
817823
export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode];
818824

825+
// @beta
826+
export const InferenceSource: {
827+
readonly ON_DEVICE: "on_device";
828+
readonly IN_CLOUD: "in_cloud";
829+
};
830+
831+
// @beta
832+
export type InferenceSource = (typeof InferenceSource)[keyof typeof InferenceSource];
833+
819834
// @public
820835
export interface InlineDataPart {
821836
// (undocumented)
@@ -911,7 +926,9 @@ export interface LanguageModelPromptOptions {
911926
// @beta
912927
export interface LiveGenerationConfig {
913928
frequencyPenalty?: number;
929+
inputAudioTranscription?: AudioTranscriptionConfig;
914930
maxOutputTokens?: number;
931+
outputAudioTranscription?: AudioTranscriptionConfig;
915932
presencePenalty?: number;
916933
responseModalities?: ResponseModality[];
917934
speechConfig?: SpeechConfig;
@@ -964,8 +981,10 @@ export type LiveResponseType = (typeof LiveResponseType)[keyof typeof LiveRespon
964981

965982
// @beta
966983
export interface LiveServerContent {
984+
inputTranscription?: Transcription;
967985
interrupted?: boolean;
968986
modelTurn?: Content;
987+
outputTranscription?: Transcription;
969988
turnComplete?: boolean;
970989
// (undocumented)
971990
type: 'serverContent';
@@ -994,9 +1013,14 @@ export class LiveSession {
9941013
isClosed: boolean;
9951014
receive(): AsyncGenerator<LiveServerContent | LiveServerToolCall | LiveServerToolCallCancellation>;
9961015
send(request: string | Array<string | Part>, turnComplete?: boolean): Promise<void>;
1016+
sendAudioRealtime(blob: GenerativeContentBlob): Promise<void>;
9971017
sendFunctionResponses(functionResponses: FunctionResponse[]): Promise<void>;
1018+
// @deprecated
9981019
sendMediaChunks(mediaChunks: GenerativeContentBlob[]): Promise<void>;
1020+
// @deprecated (undocumented)
9991021
sendMediaStream(mediaChunkStream: ReadableStream<GenerativeContentBlob>): Promise<void>;
1022+
sendTextRealtime(text: string): Promise<void>;
1023+
sendVideoRealtime(blob: GenerativeContentBlob): Promise<void>;
10001024
}
10011025

10021026
// @public
@@ -1326,6 +1350,11 @@ export interface ToolConfig {
13261350
functionCallingConfig?: FunctionCallingConfig;
13271351
}
13281352

1353+
// @beta
1354+
export interface Transcription {
1355+
text?: string;
1356+
}
1357+
13291358
// @public
13301359
export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema | AnyOfSchema;
13311360

common/api-review/auth.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ export const AuthErrorCodes: {
195195
readonly MISSING_MFA_INFO: "auth/missing-multi-factor-info";
196196
readonly MISSING_MFA_SESSION: "auth/missing-multi-factor-session";
197197
readonly MISSING_PHONE_NUMBER: "auth/missing-phone-number";
198+
readonly MISSING_PASSWORD: "auth/missing-password";
198199
readonly MISSING_SESSION_INFO: "auth/missing-verification-id";
199200
readonly MODULE_DESTROYED: "auth/app-deleted";
200201
readonly NEED_CONFIRMATION: "auth/account-exists-with-different-credential";

docs-devsite/_toc.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ toc:
1818
path: /docs/reference/js/ai.arrayschema.md
1919
- title: AudioConversationController
2020
path: /docs/reference/js/ai.audioconversationcontroller.md
21+
- title: AudioTranscriptionConfig
22+
path: /docs/reference/js/ai.audiotranscriptionconfig.md
2123
- title: Backend
2224
path: /docs/reference/js/ai.backend.md
2325
- title: BaseParams
@@ -202,6 +204,8 @@ toc:
202204
path: /docs/reference/js/ai.thinkingconfig.md
203205
- title: ToolConfig
204206
path: /docs/reference/js/ai.toolconfig.md
207+
- title: Transcription
208+
path: /docs/reference/js/ai.transcription.md
205209
- title: URLContext
206210
path: /docs/reference/js/ai.urlcontext.md
207211
- title: URLContextMetadata
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Project: /docs/reference/js/_project.yaml
2+
Book: /docs/reference/_book.yaml
3+
page_type: reference
4+
5+
{% comment %}
6+
DO NOT EDIT THIS FILE!
7+
This is generated by the JS SDK team, and any local changes will be
8+
overwritten. Changes should be made in the source code at
9+
https://github.com/firebase/firebase-js-sdk
10+
{% endcomment %}
11+
12+
# AudioTranscriptionConfig interface
13+
The audio transcription configuration.
14+
15+
<b>Signature:</b>
16+
17+
```typescript
18+
export interface AudioTranscriptionConfig
19+
```

0 commit comments

Comments
 (0)