files
Creates, updates, deletes, gets or lists a files resource.
Overview
| Name | files |
| Type | Resource |
| Id | azure.ai_agents.files |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier, which can be referenced in API endpoints. Required. |
bytes | integer | The size of the file, in bytes. Required. |
created_at | string (date-time) | The Unix timestamp, in seconds, representing when this object was created. Required. |
filename | string | The name of the file. Required. |
object | string | The object type, which is always 'file'. Required. Default value is "file". |
purpose | string | The intended purpose of a file. Required. Known values are: "assistants", "assistants_output", and "vision". (assistants, assistants_output, vision) |
status | string | The state of the file. This field is available in Azure OpenAI only. Known values are: "uploaded", "pending", "running", "processed", "error", "deleting", and "deleted". (uploaded, pending, running, processed, error, deleting, deleted) |
status_details | string | The error message with details in case processing of this file failed. This field is available in Azure OpenAI only. |
| Name | Datatype | Description |
|---|---|---|
data | array | The files returned for the request. Required. |
object | string | The object type, which is always 'list'. Required. Default value is "list". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | file_id, endpoint | Returns information about a specific file. Does not retrieve file content. | |
list | select | endpoint | purpose | Gets a list of previously uploaded files. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
endpoint | string | The service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: ) |
file_id | string | The ID of the file to retrieve. Required. |
purpose | string | The purpose of the file. Known values are: "assistants", "assistants_output", and "vision". Default value is None. |
SELECT examples
- get
- list
Returns information about a specific file. Does not retrieve file content.
SELECT
id,
bytes,
created_at,
filename,
object,
purpose,
status,
status_details
FROM azure.ai_agents.files
WHERE file_id = '{{ file_id }}' -- required
AND endpoint = '{{ endpoint }}' -- required
;
Gets a list of previously uploaded files.
SELECT
data,
object
FROM azure.ai_agents.files
WHERE endpoint = '{{ endpoint }}' -- required
AND purpose = '{{ purpose }}'
;