Skip to content

Commit 8f555d1

Browse files
committed
Merge branch 'main' into ch-ai-enums
2 parents cf320ab + ec5f374 commit 8f555d1

Some content is hidden

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

44 files changed

+1127
-1412
lines changed

.changeset/five-kids-grow.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 Grounding with Google Search.

.changeset/hip-impalas-divide.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 Thinking Budget.

.changeset/late-beers-develop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'firebase': major
3+
---
4+
5+
Remove `vertexai` import path

.changeset/rotten-taxis-allow.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 typings for `functionDeclaration.parameters`.

.changeset/thirty-eggs-laugh.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/ai': major
3+
'firebase': major
4+
---
5+
6+
Remove `VertexAI` APIs.

.changeset/twelve-walls-exist.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/firestore': patch
3+
---
4+
5+
Further improved performance of UTF-8 string ordering logic, which had degraded in v11.3.0, was reverted in v11.3.1, and was re-introduced with some improvements in v11.5.0.

common/api-review/ai.api.md

Lines changed: 51 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class AIError extends FirebaseError {
2727
}
2828

2929
// @public
30-
const AIErrorCode: {
30+
export const AIErrorCode: {
3131
readonly ERROR: "error";
3232
readonly REQUEST_ERROR: "request-error";
3333
readonly RESPONSE_ERROR: "response-error";
@@ -44,11 +44,7 @@ const AIErrorCode: {
4444
};
4545

4646
// @public
47-
type AIErrorCode = (typeof AIErrorCode)[keyof typeof AIErrorCode];
48-
49-
export { AIErrorCode }
50-
51-
export { AIErrorCode as VertexAIErrorCode }
47+
export type AIErrorCode = (typeof AIErrorCode)[keyof typeof AIErrorCode];
5248

5349
// @public
5450
export abstract class AIModel {
@@ -293,7 +289,7 @@ export interface FunctionCallPart {
293289
export interface FunctionDeclaration {
294290
description: string;
295291
name: string;
296-
parameters?: ObjectSchemaInterface;
292+
parameters?: ObjectSchema | ObjectSchemaRequest;
297293
}
298294

299295
// @public
@@ -393,6 +389,7 @@ export interface GenerationConfig {
393389
stopSequences?: string[];
394390
// (undocumented)
395391
temperature?: number;
392+
thinkingConfig?: ThinkingConfig;
396393
// (undocumented)
397394
topK?: number;
398395
// (undocumented)
@@ -436,9 +433,6 @@ export function getGenerativeModel(ai: AI, modelParams: ModelParams, requestOpti
436433
// @beta
437434
export function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel;
438435

439-
// @public @deprecated (undocumented)
440-
export function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI;
441-
442436
// @public
443437
export class GoogleAIBackend extends Backend {
444438
constructor();
@@ -498,6 +492,15 @@ export interface GoogleAIGenerateContentResponse {
498492
usageMetadata?: UsageMetadata;
499493
}
500494

495+
// @public
496+
export interface GoogleSearch {
497+
}
498+
499+
// @public
500+
export interface GoogleSearchTool {
501+
googleSearch: GoogleSearch;
502+
}
503+
501504
// @public @deprecated (undocumented)
502505
export interface GroundingAttribution {
503506
// (undocumented)
@@ -510,16 +513,29 @@ export interface GroundingAttribution {
510513
web?: WebAttribution;
511514
}
512515

516+
// @public
517+
export interface GroundingChunk {
518+
web?: WebGroundingChunk;
519+
}
520+
513521
// @public
514522
export interface GroundingMetadata {
515523
// @deprecated (undocumented)
516524
groundingAttributions: GroundingAttribution[];
517-
// (undocumented)
525+
groundingChunks?: GroundingChunk[];
526+
groundingSupports?: GroundingSupport[];
527+
// @deprecated (undocumented)
518528
retrievalQueries?: string[];
519-
// (undocumented)
529+
searchEntryPoint?: SearchEntrypoint;
520530
webSearchQueries?: string[];
521531
}
522532

533+
// @public
534+
export interface GroundingSupport {
535+
groundingChunkIndices?: number[];
536+
segment?: Segment;
537+
}
538+
523539
// @public
524540
export const HarmBlockMethod: {
525541
readonly SEVERITY: "SEVERITY";
@@ -738,9 +754,8 @@ export class ObjectSchema extends Schema {
738754
}
739755

740756
// @public
741-
export interface ObjectSchemaInterface extends SchemaInterface {
742-
// (undocumented)
743-
optionalProperties?: string[];
757+
export interface ObjectSchemaRequest extends SchemaRequest {
758+
optionalProperties?: never;
744759
// (undocumented)
745760
type: 'object';
746761
}
@@ -896,14 +911,17 @@ export const SchemaType: {
896911
// @public
897912
export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType];
898913

899-
// @public (undocumented)
914+
// @public
915+
export interface SearchEntrypoint {
916+
renderedContent?: string;
917+
}
918+
919+
// @public
900920
export interface Segment {
901-
// (undocumented)
902921
endIndex: number;
903-
// (undocumented)
904922
partIndex: number;
905-
// (undocumented)
906923
startIndex: number;
924+
text: string;
907925
}
908926

909927
// @public
@@ -940,7 +958,12 @@ export interface TextPart {
940958
}
941959

942960
// @public
943-
export type Tool = FunctionDeclarationsTool;
961+
export interface ThinkingConfig {
962+
thinkingBudget?: number;
963+
}
964+
965+
// @public
966+
export type Tool = FunctionDeclarationsTool | GoogleSearchTool;
944967

945968
// @public
946969
export interface ToolConfig {
@@ -961,31 +984,17 @@ export interface UsageMetadata {
961984
promptTokenCount: number;
962985
// (undocumented)
963986
promptTokensDetails?: ModalityTokenCount[];
987+
thoughtsTokenCount?: number;
964988
// (undocumented)
965989
totalTokenCount: number;
966990
}
967991

968-
// @public @deprecated (undocumented)
969-
export type VertexAI = AI;
970-
971992
// @public
972993
export class VertexAIBackend extends Backend {
973994
constructor(location?: string);
974995
readonly location: string;
975996
}
976997

977-
// @public @deprecated (undocumented)
978-
export const VertexAIError: typeof AIError;
979-
980-
// @public @deprecated (undocumented)
981-
export const VertexAIModel: typeof AIModel;
982-
983-
// @public
984-
export interface VertexAIOptions {
985-
// (undocumented)
986-
location?: string;
987-
}
988-
989998
// @public
990999
export interface VideoMetadata {
9911000
endOffset: string;
@@ -1000,5 +1009,12 @@ export interface WebAttribution {
10001009
uri: string;
10011010
}
10021011

1012+
// @public
1013+
export interface WebGroundingChunk {
1014+
domain?: string;
1015+
title?: string;
1016+
uri?: string;
1017+
}
1018+
10031019

10041020
```

0 commit comments

Comments
 (0)