aymara_ai.resources.files#
Classes#
Module Contents#
- class aymara_ai.resources.files.FilesResource(client)[source]#
Bases:
aymara_ai._resource.SyncAPIResource
- Parameters:
client (aymara_ai._client.AymaraAI)
- property with_raw_response: FilesResourceWithRawResponse#
This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.
For more information, see https://www.github.com/aymara-ai/aymara-sdk-python#accessing-raw-response-data-eg-headers
- Return type:
FilesResourceWithRawResponse
- property with_streaming_response: FilesResourceWithStreamingResponse#
An alternative to .with_raw_response that doesn’t eagerly read the response body.
For more information, see https://www.github.com/aymara-ai/aymara-sdk-python#with_streaming_response
- Return type:
FilesResourceWithStreamingResponse
- create(*, files, workspace_uuid=NOT_GIVEN, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)[source]#
Requests to upload one or more files to be used in an eval run.
Args: upload_request (FileUploadRequest): Contains the files to upload and the workspace UUID.
Returns: FileUploadResponse: Contains presigned URLs and metadata to upload each file.
Raises: AymaraAPIError: If the organization is missing or file upload fails.
Example: POST /api/files { “workspace_uuid”: “…”, “files”: [ {“local_file_path”: “path/to/file1.csv”}, {“local_file_path”: “path/to/file2.csv”} ] }
- Parameters:
files (Iterable[aymara_ai.types.file_create_params.File]) – List of files to upload.
workspace_uuid (Optional[str] | aymara_ai._types.NotGiven) – UUID of the workspace to associate with the upload, if any.
extra_headers (aymara_ai._types.Headers | None) – Send extra headers
extra_query (aymara_ai._types.Query | None) – Add additional query parameters to the request
extra_body (aymara_ai._types.Body | None) – Add additional JSON properties to the request
timeout (float | httpx.Timeout | None | aymara_ai._types.NotGiven) – Override the client-level default timeout for this request, in seconds
- Return type:
- upload(*, file, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)[source]#
Receives a file and streams it to S3 using multipart upload in a single request.
- Parameters:
extra_headers (aymara_ai._types.Headers | None) – Send extra headers
extra_query (aymara_ai._types.Query | None) – Add additional query parameters to the request
extra_body (aymara_ai._types.Body | None) – Add additional JSON properties to the request
timeout (float | httpx.Timeout | None | aymara_ai._types.NotGiven) – Override the client-level default timeout for this request, in seconds
file (aymara_ai._types.FileTypes)
- Return type:
- class aymara_ai.resources.files.AsyncFilesResource(client)[source]#
Bases:
aymara_ai._resource.AsyncAPIResource
- Parameters:
client (aymara_ai._client.AsyncAymaraAI)
- property with_raw_response: AsyncFilesResourceWithRawResponse#
This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.
For more information, see https://www.github.com/aymara-ai/aymara-sdk-python#accessing-raw-response-data-eg-headers
- Return type:
AsyncFilesResourceWithRawResponse
- property with_streaming_response: AsyncFilesResourceWithStreamingResponse#
An alternative to .with_raw_response that doesn’t eagerly read the response body.
For more information, see https://www.github.com/aymara-ai/aymara-sdk-python#with_streaming_response
- Return type:
AsyncFilesResourceWithStreamingResponse
- async create(*, files, workspace_uuid=NOT_GIVEN, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)[source]#
Requests to upload one or more files to be used in an eval run.
Args: upload_request (FileUploadRequest): Contains the files to upload and the workspace UUID.
Returns: FileUploadResponse: Contains presigned URLs and metadata to upload each file.
Raises: AymaraAPIError: If the organization is missing or file upload fails.
Example: POST /api/files { “workspace_uuid”: “…”, “files”: [ {“local_file_path”: “path/to/file1.csv”}, {“local_file_path”: “path/to/file2.csv”} ] }
- Parameters:
files (Iterable[aymara_ai.types.file_create_params.File]) – List of files to upload.
workspace_uuid (Optional[str] | aymara_ai._types.NotGiven) – UUID of the workspace to associate with the upload, if any.
extra_headers (aymara_ai._types.Headers | None) – Send extra headers
extra_query (aymara_ai._types.Query | None) – Add additional query parameters to the request
extra_body (aymara_ai._types.Body | None) – Add additional JSON properties to the request
timeout (float | httpx.Timeout | None | aymara_ai._types.NotGiven) – Override the client-level default timeout for this request, in seconds
- Return type:
- async upload(*, file, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)[source]#
Receives a file and streams it to S3 using multipart upload in a single request.
- Parameters:
extra_headers (aymara_ai._types.Headers | None) – Send extra headers
extra_query (aymara_ai._types.Query | None) – Add additional query parameters to the request
extra_body (aymara_ai._types.Body | None) – Add additional JSON properties to the request
timeout (float | httpx.Timeout | None | aymara_ai._types.NotGiven) – Override the client-level default timeout for this request, in seconds
file (aymara_ai._types.FileTypes)
- Return type: