From 546f220a16517276daec8f136a69a6cc1ffd7059 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 30 Jan 2025 11:06:25 -0500 Subject: [PATCH 1/3] Add missing BlockReason and FinishReason enum values --- .changeset/fifty-pans-fail.md | 5 +++++ common/api-review/vertexai.api.md | 12 ++++++++++++ docs-devsite/vertexai.md | 6 ++++++ packages/vertexai/src/types/enums.ts | 16 ++++++++++++++-- 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .changeset/fifty-pans-fail.md diff --git a/.changeset/fifty-pans-fail.md b/.changeset/fifty-pans-fail.md new file mode 100644 index 00000000000..6c042ee79ce --- /dev/null +++ b/.changeset/fifty-pans-fail.md @@ -0,0 +1,5 @@ +--- +'@firebase/vertexai': patch +--- + +Added missing `BlockReason` and `FinishReason` enum values. diff --git a/common/api-review/vertexai.api.md b/common/api-review/vertexai.api.md index 041bc62451f..4ec4b608db1 100644 --- a/common/api-review/vertexai.api.md +++ b/common/api-review/vertexai.api.md @@ -28,9 +28,13 @@ export interface BaseParams { // @public export enum BlockReason { + // (undocumented) + BLOCKLIST = "BLOCKLIST", // (undocumented) OTHER = "OTHER", // (undocumented) + PROHIBITED_CONTENT = "PROHIBITED_CONTENT", + // (undocumented) SAFETY = "SAFETY" } @@ -157,15 +161,23 @@ export interface FileDataPart { // @public export enum FinishReason { + // (undocumented) + BLOCKLIST = "BLOCKLIST", + // (undocumented) + MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL", // (undocumented) MAX_TOKENS = "MAX_TOKENS", // (undocumented) OTHER = "OTHER", // (undocumented) + PROHIBITED_CONTENT = "PROHIBITED_CONTENT", + // (undocumented) RECITATION = "RECITATION", // (undocumented) SAFETY = "SAFETY", // (undocumented) + SPII = "SPII", + // (undocumented) STOP = "STOP" } diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md index d9e26eabc5d..98e26e42083 100644 --- a/docs-devsite/vertexai.md +++ b/docs-devsite/vertexai.md @@ -231,7 +231,9 @@ export declare enum BlockReason | Member | Value | Description | | --- | --- | --- | +| BLOCKLIST | "BLOCKLIST" | | | OTHER | "OTHER" | | +| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | | | SAFETY | "SAFETY" | | ## FinishReason @@ -248,10 +250,14 @@ export declare enum FinishReason | Member | Value | Description | | --- | --- | --- | +| BLOCKLIST | "BLOCKLIST" | | +| MALFORMED\_FUNCTION\_CALL | "MALFORMED_FUNCTION_CALL" | | | MAX\_TOKENS | "MAX_TOKENS" | | | OTHER | "OTHER" | | +| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | | | RECITATION | "RECITATION" | | | SAFETY | "SAFETY" | | +| SPII | "SPII" | | | STOP | "STOP" | | ## FunctionCallingMode diff --git a/packages/vertexai/src/types/enums.ts b/packages/vertexai/src/types/enums.ts index 3e66bacc612..1f12edceaf6 100644 --- a/packages/vertexai/src/types/enums.ts +++ b/packages/vertexai/src/types/enums.ts @@ -101,7 +101,11 @@ export enum BlockReason { // Content was blocked by safety settings. SAFETY = 'SAFETY', // Content was blocked, but the reason is uncategorized. - OTHER = 'OTHER' + OTHER = 'OTHER', + // Content was blocked because it contained terms from the terminology blocklist. + BLOCKLIST = 'BLOCKLIST', + // Content was blocked due to prohibited content. + PROHIBITED_CONTENT = 'PROHIBITED_CONTENT' } /** @@ -118,7 +122,15 @@ export enum FinishReason { // The candidate content was flagged for recitation reasons. RECITATION = 'RECITATION', // Unknown reason. - OTHER = 'OTHER' + OTHER = 'OTHER', + // The candidate content contained forbidden terms. + BLOCKLIST = 'BLOCKLIST', + // The candidate content potentially contained prohibited content. + PROHIBITED_CONTENT = 'PROHIBITED_CONTENT', + // The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). + SPII = 'SPII', + // The function call generated by the model was invalid. + MALFORMED_FUNCTION_CALL = 'MALFORMED_FUNCTION_CALL' } /** From 151c3d74ad83789ab04248ebc9d4c15f695aabbd Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 30 Jan 2025 15:26:57 -0500 Subject: [PATCH 2/3] Fix changeset --- .changeset/{fifty-pans-fail.md => stupid-apples-shave.md} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename .changeset/{fifty-pans-fail.md => stupid-apples-shave.md} (60%) diff --git a/.changeset/fifty-pans-fail.md b/.changeset/stupid-apples-shave.md similarity index 60% rename from .changeset/fifty-pans-fail.md rename to .changeset/stupid-apples-shave.md index 6c042ee79ce..a76a3808056 100644 --- a/.changeset/fifty-pans-fail.md +++ b/.changeset/stupid-apples-shave.md @@ -1,5 +1,6 @@ --- -'@firebase/vertexai': patch +'@firebase/vertexai': minor +'firebase': minor --- Added missing `BlockReason` and `FinishReason` enum values. From 3bb9992edc60f18d68640b1b3826536fbe9dac49 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Fri, 31 Jan 2025 11:07:59 -0500 Subject: [PATCH 3/3] fix doc style --- common/api-review/vertexai.api.md | 6 ------ docs-devsite/vertexai.md | 12 ++++++------ packages/vertexai/src/types/enums.ts | 24 ++++++++++++++++++------ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/common/api-review/vertexai.api.md b/common/api-review/vertexai.api.md index 4ec4b608db1..9799d4995d5 100644 --- a/common/api-review/vertexai.api.md +++ b/common/api-review/vertexai.api.md @@ -28,11 +28,9 @@ export interface BaseParams { // @public export enum BlockReason { - // (undocumented) BLOCKLIST = "BLOCKLIST", // (undocumented) OTHER = "OTHER", - // (undocumented) PROHIBITED_CONTENT = "PROHIBITED_CONTENT", // (undocumented) SAFETY = "SAFETY" @@ -161,21 +159,17 @@ export interface FileDataPart { // @public export enum FinishReason { - // (undocumented) BLOCKLIST = "BLOCKLIST", - // (undocumented) MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL", // (undocumented) MAX_TOKENS = "MAX_TOKENS", // (undocumented) OTHER = "OTHER", - // (undocumented) PROHIBITED_CONTENT = "PROHIBITED_CONTENT", // (undocumented) RECITATION = "RECITATION", // (undocumented) SAFETY = "SAFETY", - // (undocumented) SPII = "SPII", // (undocumented) STOP = "STOP" diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md index 98e26e42083..724d0f59b47 100644 --- a/docs-devsite/vertexai.md +++ b/docs-devsite/vertexai.md @@ -231,9 +231,9 @@ export declare enum BlockReason | Member | Value | Description | | --- | --- | --- | -| BLOCKLIST | "BLOCKLIST" | | +| BLOCKLIST | "BLOCKLIST" | Content was blocked because it contained terms from the terminology blocklist. | | OTHER | "OTHER" | | -| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | | +| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | Content was blocked due to prohibited content. | | SAFETY | "SAFETY" | | ## FinishReason @@ -250,14 +250,14 @@ export declare enum FinishReason | Member | Value | Description | | --- | --- | --- | -| BLOCKLIST | "BLOCKLIST" | | -| MALFORMED\_FUNCTION\_CALL | "MALFORMED_FUNCTION_CALL" | | +| BLOCKLIST | "BLOCKLIST" | The candidate content contained forbidden terms. | +| MALFORMED\_FUNCTION\_CALL | "MALFORMED_FUNCTION_CALL" | The function call generated by the model was invalid. | | MAX\_TOKENS | "MAX_TOKENS" | | | OTHER | "OTHER" | | -| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | | +| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT" | The candidate content potentially contained prohibited content. | | RECITATION | "RECITATION" | | | SAFETY | "SAFETY" | | -| SPII | "SPII" | | +| SPII | "SPII" | The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). | | STOP | "STOP" | | ## FunctionCallingMode diff --git a/packages/vertexai/src/types/enums.ts b/packages/vertexai/src/types/enums.ts index 1f12edceaf6..bdaa2d28939 100644 --- a/packages/vertexai/src/types/enums.ts +++ b/packages/vertexai/src/types/enums.ts @@ -102,9 +102,13 @@ export enum BlockReason { SAFETY = 'SAFETY', // Content was blocked, but the reason is uncategorized. OTHER = 'OTHER', - // Content was blocked because it contained terms from the terminology blocklist. + /** + * Content was blocked because it contained terms from the terminology blocklist. + */ BLOCKLIST = 'BLOCKLIST', - // Content was blocked due to prohibited content. + /** + * Content was blocked due to prohibited content. + */ PROHIBITED_CONTENT = 'PROHIBITED_CONTENT' } @@ -123,13 +127,21 @@ export enum FinishReason { RECITATION = 'RECITATION', // Unknown reason. OTHER = 'OTHER', - // The candidate content contained forbidden terms. + /** + * The candidate content contained forbidden terms. + */ BLOCKLIST = 'BLOCKLIST', - // The candidate content potentially contained prohibited content. + /** + * The candidate content potentially contained prohibited content. + */ PROHIBITED_CONTENT = 'PROHIBITED_CONTENT', - // The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). + /** + * The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). + */ SPII = 'SPII', - // The function call generated by the model was invalid. + /** + * The function call generated by the model was invalid. + */ MALFORMED_FUNCTION_CALL = 'MALFORMED_FUNCTION_CALL' }