Package com.azure.ai.agents.persistent
Class FilesClient
java.lang.Object
com.azure.ai.agents.persistent.FilesClient
Initializes a new instance of the synchronous PersistentAgentsAdministrationClient type.
-
Method Summary
Modifier and TypeMethodDescriptiondeleteFile(String fileId) Delete a previously uploaded file.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.com.azure.core.util.BinaryDatagetFileContent(String fileId) Retrieves the raw content of a specific file.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.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.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 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
Response. - 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 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
Response. - 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 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
Response. - 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 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
Response. - 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.
- 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.
- 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.
- 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.
- 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.
- 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.
-