From c38d5c0947acf2926a0d4103eb277219c41de564 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Fri, 17 May 2024 10:24:25 -0700 Subject: [PATCH 1/3] FileState enums should be strings --- packages/main/src/files/types.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/main/src/files/types.ts b/packages/main/src/files/types.ts index 14d83987..ad57cae0 100644 --- a/packages/main/src/files/types.ts +++ b/packages/main/src/files/types.ts @@ -74,11 +74,11 @@ export interface UploadFileResponse { */ export enum FileState { // The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0, + STATE_UNSPECIFIED = 'STATE_UNSPECIFIED', // File is being processed and cannot be used for inference yet. - PROCESSING = 1, + PROCESSING = 'PROCESSING', // File is processed and available for inference. - ACTIVE = 2, + ACTIVE = 'ACTIVE', // File failed processing. - FAILED = 10, + FAILED = 'FAILED', } From 90331eba8d46f0c0122a199b063e9d593700d353 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Fri, 17 May 2024 10:26:00 -0700 Subject: [PATCH 2/3] changeset --- .changeset/brave-cats-run.md | 5 +++++ packages/main/src/files/types.ts | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/brave-cats-run.md diff --git a/.changeset/brave-cats-run.md b/.changeset/brave-cats-run.md new file mode 100644 index 00000000..a617fb7f --- /dev/null +++ b/.changeset/brave-cats-run.md @@ -0,0 +1,5 @@ +--- +"@google/generative-ai": patch +--- + +Fixed `FileState` enum values to be strings. diff --git a/packages/main/src/files/types.ts b/packages/main/src/files/types.ts index ad57cae0..2e0ca959 100644 --- a/packages/main/src/files/types.ts +++ b/packages/main/src/files/types.ts @@ -74,11 +74,11 @@ export interface UploadFileResponse { */ export enum FileState { // The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 'STATE_UNSPECIFIED', + STATE_UNSPECIFIED = "STATE_UNSPECIFIED", // File is being processed and cannot be used for inference yet. - PROCESSING = 'PROCESSING', + PROCESSING = "PROCESSING", // File is processed and available for inference. - ACTIVE = 'ACTIVE', + ACTIVE = "ACTIVE", // File failed processing. - FAILED = 'FAILED', + FAILED = "FAILED", } From 02e199218dce7b7388bb7b8eb9883e1b38c21f22 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Fri, 17 May 2024 10:57:26 -0700 Subject: [PATCH 3/3] docs update --- docs/reference/files/generative-ai.filestate.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/reference/files/generative-ai.filestate.md b/docs/reference/files/generative-ai.filestate.md index b8242952..55c475c6 100644 --- a/docs/reference/files/generative-ai.filestate.md +++ b/docs/reference/files/generative-ai.filestate.md @@ -16,8 +16,8 @@ export declare enum FileState | Member | Value | Description | | --- | --- | --- | -| ACTIVE | 2 | | -| FAILED | 10 | | -| PROCESSING | 1 | | -| STATE\_UNSPECIFIED | 0 | | +| ACTIVE | "ACTIVE" | | +| FAILED | "FAILED" | | +| PROCESSING | "PROCESSING" | | +| STATE\_UNSPECIFIED | "STATE_UNSPECIFIED" | |