FileManager
Gemini Files API — upload and manage files for use in model requests
Inherits: EndPoint
Operations
Delete
Delete a file resource
function : Delete(file_name:String, key:String) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| file_name | String | resource name (e.g. "files/abc123") |
| key | String | API key |
Return
| Type | Description |
|---|---|
| Bool | true if deleted successfully |
Get
Get metadata for a specific file
function : Get(file_name:String, key:String) ~ GeminiFileParameters
| Name | Type | Description |
|---|---|---|
| file_name | String | resource name (e.g. "files/abc123") |
| key | String | API key |
Return
| Type | Description |
|---|---|
| GeminiFile | file resource, or Nil on failure |
List
List all uploaded files
function : List(key:String) ~ Vector<GeminiFile>Parameters
| Name | Type | Description |
|---|---|---|
| key | String | API key |
Return
| Type | Description |
|---|---|
| Vector<GeminiFile> | list of file resources |
Upload
Upload a file using multipart upload
function : Upload(display_name:String, data:Byte[], mime_type:String, key:String) ~ GeminiFileParameters
| Name | Type | Description |
|---|---|---|
| display_name | String | human-readable name |
| data | Byte | raw file bytes |
| mime_type | String | MIME type (e.g. "image/png", "text/plain") |
| key | String | API key |
Return
| Type | Description |
|---|---|
| GeminiFile | uploaded file resource, or Nil on failure |