Skip to content

Commit c7c0b50

Browse files
authoredMay 17, 2024··
FileState enums should be strings (#141)
1 parent 434acde commit c7c0b50

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed
 

‎.changeset/brave-cats-run.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@google/generative-ai": patch
3+
---
4+
5+
Fixed `FileState` enum values to be strings.

‎docs/reference/files/generative-ai.filestate.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export declare enum FileState
1616

1717
| Member | Value | Description |
1818
| --- | --- | --- |
19-
| ACTIVE | <code>2</code> | |
20-
| FAILED | <code>10</code> | |
21-
| PROCESSING | <code>1</code> | |
22-
| STATE\_UNSPECIFIED | <code>0</code> | |
19+
| ACTIVE | <code>&quot;ACTIVE&quot;</code> | |
20+
| FAILED | <code>&quot;FAILED&quot;</code> | |
21+
| PROCESSING | <code>&quot;PROCESSING&quot;</code> | |
22+
| STATE\_UNSPECIFIED | <code>&quot;STATE_UNSPECIFIED&quot;</code> | |
2323

‎packages/main/src/files/types.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ export interface UploadFileResponse {
7474
*/
7575
export enum FileState {
7676
// The default value. This value is used if the state is omitted.
77-
STATE_UNSPECIFIED = 0,
77+
STATE_UNSPECIFIED = "STATE_UNSPECIFIED",
7878
// File is being processed and cannot be used for inference yet.
79-
PROCESSING = 1,
79+
PROCESSING = "PROCESSING",
8080
// File is processed and available for inference.
81-
ACTIVE = 2,
81+
ACTIVE = "ACTIVE",
8282
// File failed processing.
83-
FAILED = 10,
83+
FAILED = "FAILED",
8484
}

0 commit comments

Comments
 (0)
Please sign in to comment.