files
Classes:
Name | Description |
---|---|
AsyncFiles |
|
AsyncFilesWithRawResponse |
|
AsyncFilesWithStreamingResponse |
|
Files |
|
FilesWithRawResponse |
|
FilesWithStreamingResponse |
|
AsyncFiles
AsyncFiles(client: AsyncOpenAI)
Methods:
Name | Description |
---|---|
create |
Create an assistant file by attaching a |
delete |
Delete an assistant file. |
list |
Returns a list of assistant files. |
retrieve |
Retrieves an AssistantFile. |
with_raw_response |
|
with_streaming_response |
|
create
async
create(
assistant_id: str,
*,
file_id: str,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AssistantFile
Create an assistant file by attaching a File to an assistant.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_id
|
str
|
A File ID (with
|
required |
extra_headers
|
Headers | None
|
Send extra headers |
None
|
extra_query
|
Query | None
|
Add additional query parameters to the request |
None
|
extra_body
|
Body | None
|
Add additional JSON properties to the request |
None
|
timeout
|
float | Timeout | None | NotGiven
|
Override the client-level default timeout for this request, in seconds |
NOT_GIVEN
|
delete
async
delete(
file_id: str,
*,
assistant_id: str,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> FileDeleteResponse
Delete an assistant file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
extra_headers
|
Headers | None
|
Send extra headers |
None
|
extra_query
|
Query | None
|
Add additional query parameters to the request |
None
|
extra_body
|
Body | None
|
Add additional JSON properties to the request |
None
|
timeout
|
float | Timeout | None | NotGiven
|
Override the client-level default timeout for this request, in seconds |
NOT_GIVEN
|
list
list(
assistant_id: str,
*,
after: str | NotGiven = NOT_GIVEN,
before: str | NotGiven = NOT_GIVEN,
limit: int | NotGiven = NOT_GIVEN,
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AsyncPaginator[
AssistantFile, AsyncCursorPage[AssistantFile]
]
Returns a list of assistant files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
after
|
str | NotGiven
|
A cursor for use in pagination. |
NOT_GIVEN
|
before
|
str | NotGiven
|
A cursor for use in pagination. |
NOT_GIVEN
|
limit
|
int | NotGiven
|
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. |
NOT_GIVEN
|
order
|
Literal['asc', 'desc'] | NotGiven
|
Sort order by the |
NOT_GIVEN
|
extra_headers
|
Headers | None
|
Send extra headers |
None
|
extra_query
|
Query | None
|
Add additional query parameters to the request |
None
|
extra_body
|
Body | None
|
Add additional JSON properties to the request |
None
|
timeout
|
float | Timeout | None | NotGiven
|
Override the client-level default timeout for this request, in seconds |
NOT_GIVEN
|
retrieve
async
retrieve(
file_id: str,
*,
assistant_id: str,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AssistantFile
Retrieves an AssistantFile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
extra_headers
|
Headers | None
|
Send extra headers |
None
|
extra_query
|
Query | None
|
Add additional query parameters to the request |
None
|
extra_body
|
Body | None
|
Add additional JSON properties to the request |
None
|
timeout
|
float | Timeout | None | NotGiven
|
Override the client-level default timeout for this request, in seconds |
NOT_GIVEN
|
AsyncFilesWithRawResponse
AsyncFilesWithRawResponse(files: AsyncFiles)
AsyncFilesWithStreamingResponse
AsyncFilesWithStreamingResponse(files: AsyncFiles)
Files
Files(client: OpenAI)
Methods:
Name | Description |
---|---|
create |
Create an assistant file by attaching a |
delete |
Delete an assistant file. |
list |
Returns a list of assistant files. |
retrieve |
Retrieves an AssistantFile. |
with_raw_response |
|
with_streaming_response |
|
create
create(
assistant_id: str,
*,
file_id: str,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AssistantFile
Create an assistant file by attaching a File to an assistant.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_id
|
str
|
A File ID (with
|
required |
extra_headers
|
Headers | None
|
Send extra headers |
None
|
extra_query
|
Query | None
|
Add additional query parameters to the request |
None
|
extra_body
|
Body | None
|
Add additional JSON properties to the request |
None
|
timeout
|
float | Timeout | None | NotGiven
|
Override the client-level default timeout for this request, in seconds |
NOT_GIVEN
|
delete
delete(
file_id: str,
*,
assistant_id: str,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> FileDeleteResponse
Delete an assistant file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
extra_headers
|
Headers | None
|
Send extra headers |
None
|
extra_query
|
Query | None
|
Add additional query parameters to the request |
None
|
extra_body
|
Body | None
|
Add additional JSON properties to the request |
None
|
timeout
|
float | Timeout | None | NotGiven
|
Override the client-level default timeout for this request, in seconds |
NOT_GIVEN
|
list
list(
assistant_id: str,
*,
after: str | NotGiven = NOT_GIVEN,
before: str | NotGiven = NOT_GIVEN,
limit: int | NotGiven = NOT_GIVEN,
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> SyncCursorPage[AssistantFile]
Returns a list of assistant files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
after
|
str | NotGiven
|
A cursor for use in pagination. |
NOT_GIVEN
|
before
|
str | NotGiven
|
A cursor for use in pagination. |
NOT_GIVEN
|
limit
|
int | NotGiven
|
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. |
NOT_GIVEN
|
order
|
Literal['asc', 'desc'] | NotGiven
|
Sort order by the |
NOT_GIVEN
|
extra_headers
|
Headers | None
|
Send extra headers |
None
|
extra_query
|
Query | None
|
Add additional query parameters to the request |
None
|
extra_body
|
Body | None
|
Add additional JSON properties to the request |
None
|
timeout
|
float | Timeout | None | NotGiven
|
Override the client-level default timeout for this request, in seconds |
NOT_GIVEN
|
retrieve
retrieve(
file_id: str,
*,
assistant_id: str,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AssistantFile
Retrieves an AssistantFile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
extra_headers
|
Headers | None
|
Send extra headers |
None
|
extra_query
|
Query | None
|
Add additional query parameters to the request |
None
|
extra_body
|
Body | None
|
Add additional JSON properties to the request |
None
|
timeout
|
float | Timeout | None | NotGiven
|
Override the client-level default timeout for this request, in seconds |
NOT_GIVEN
|
FilesWithRawResponse
FilesWithRawResponse(files: Files)