From c7c0b501f89d0b3a6691dbb9b612f71ece05e327 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Fri, 17 May 2024 11:00:30 -0700 Subject: [PATCH] FileState enums should be strings (#141) --- .changeset/brave-cats-run.md | 5 +++++ docs/reference/files/generative-ai.filestate.md | 8 ++++---- packages/main/src/files/types.ts | 8 ++++---- 3 files changed, 13 insertions(+), 8 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/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" | | diff --git a/packages/main/src/files/types.ts b/packages/main/src/files/types.ts index 14d83987..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 = 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", }