Package com.azure.ai.agents.persistent
Class FilesAsyncClient
java.lang.Object
com.azure.ai.agents.persistent.FilesAsyncClient
Initializes a new instance of the asynchronous PersistentAgentsAdministrationClient type.
-
Method Summary
Modifier and TypeMethodDescriptiondeleteFile(String fileId) Delete a previously uploaded file.Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> deleteFileWithResponse(String fileId, com.azure.core.http.rest.RequestOptions requestOptions) Delete a previously uploaded file.Returns information about a specific file.Mono<com.azure.core.util.BinaryData> getFileContent(String fileId) Retrieves the raw content of a specific file.Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getFileContentWithResponse(String fileId, com.azure.core.http.rest.RequestOptions requestOptions) Retrieves the raw content of a specific file.Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getFileWithResponse(String fileId, com.azure.core.http.rest.RequestOptions requestOptions) Returns information about a specific file.Gets a list of previously uploaded files.listFiles(FilePurpose purpose) Gets a list of previously uploaded files.Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> listFilesWithResponse(com.azure.core.http.rest.RequestOptions requestOptions) Gets a list of previously uploaded files.
-
Method Details
-
listFilesWithResponse
public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> listFilesWithResponse(com.azure.core.http.rest.RequestOptions requestOptions) Gets a list of previously uploaded files.Query Parameters
You can add these to a request withQuery Parameters Name Type Required Description purpose String No The purpose of the file. Allowed values: "fine-tune", "fine-tune-results", "assistants", "assistants_output", "batch", "batch_output", "vision". RequestOptions.addQueryParam(java.lang.String, java.lang.String)Response Body Schema
{ object: String (Required) data (Required): [ (Required){ object: String (Required) id: String (Required) bytes: int (Required) filename: String (Required) created_at: long (Required) purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required) status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional) status_details: String (Optional) } ] }- Parameters:
requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- a list of previously uploaded files along with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
deleteFileWithResponse
public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> deleteFileWithResponse(String fileId, com.azure.core.http.rest.RequestOptions requestOptions) Delete a previously uploaded file.Response Body Schema
{ id: String (Required) deleted: boolean (Required) object: String (Required) }- Parameters:
fileId- The ID of the file to delete.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- a status response from a file deletion operation along with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
getFileWithResponse
public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getFileWithResponse(String fileId, com.azure.core.http.rest.RequestOptions requestOptions) Returns information about a specific file. Does not retrieve file content.Response Body Schema
{ object: String (Required) id: String (Required) bytes: int (Required) filename: String (Required) created_at: long (Required) purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required) status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional) status_details: String (Optional) }- Parameters:
fileId- The ID of the file to retrieve.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- represents an agent that can call the model and use tools along with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
getFileContentWithResponse
public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getFileContentWithResponse(String fileId, com.azure.core.http.rest.RequestOptions requestOptions) Retrieves the raw content of a specific file.Response Body Schema
BinaryData- Parameters:
fileId- The ID of the file to retrieve.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- the response body along with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
listFiles
Gets a list of previously uploaded files.- Parameters:
purpose- The purpose of the file.- Returns:
- a list of previously uploaded files on successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
listFiles
Gets a list of previously uploaded files.- Returns:
- a list of previously uploaded files on successful completion of
Mono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
deleteFile
Delete a previously uploaded file.- Parameters:
fileId- The ID of the file to delete.- Returns:
- a status response from a file deletion operation on successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getFile
Returns information about a specific file. Does not retrieve file content.- Parameters:
fileId- The ID of the file to retrieve.- Returns:
- represents an agent that can call the model and use tools on successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getFileContent
Retrieves the raw content of a specific file.- Parameters:
fileId- The ID of the file to retrieve.- Returns:
- the response body on successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-