Skip to content

Commit

Permalink
FileState enums should be strings (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 authored May 17, 2024
1 parent 434acde commit c7c0b50
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-cats-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@google/generative-ai": patch
---

Fixed `FileState` enum values to be strings.
8 changes: 4 additions & 4 deletions docs/reference/files/generative-ai.filestate.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export declare enum FileState

| Member | Value | Description |
| --- | --- | --- |
| ACTIVE | <code>2</code> | |
| FAILED | <code>10</code> | |
| PROCESSING | <code>1</code> | |
| STATE\_UNSPECIFIED | <code>0</code> | |
| ACTIVE | <code>&quot;ACTIVE&quot;</code> | |
| FAILED | <code>&quot;FAILED&quot;</code> | |
| PROCESSING | <code>&quot;PROCESSING&quot;</code> | |
| STATE\_UNSPECIFIED | <code>&quot;STATE_UNSPECIFIED&quot;</code> | |

8 changes: 4 additions & 4 deletions packages/main/src/files/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}

0 comments on commit c7c0b50

Please sign in to comment.