Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileState enums should be strings #141

Merged
merged 3 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
}
Loading