次の方法で共有


FilesClient Class

  • java.lang.Object
    • com.azure.ai.agents.persistent.FilesClient

public final class FilesClient

Initializes a new instance of the synchronous Files type.

Method Summary

Modifier and Type Method and Description
void deleteFile(String fileId)

Delete a previously uploaded file.

FileInfo getFile(String fileId)

Returns information about a specific file.

BinaryData getFileContent(String fileId)

Retrieves the raw content of a specific file.

Response<BinaryData> getFileContentWithResponse(String fileId, RequestOptions requestOptions)

Retrieves the raw content of a specific file.

Response<BinaryData> getFileWithResponse(String fileId, RequestOptions requestOptions)

Returns information about a specific file.

List<FileInfo> listFiles()

Gets a list of previously uploaded files.

List<FileInfo> listFiles(FilePurpose purpose)

Gets a list of previously uploaded files.

FileListResponse listFilesInternal()

Gets a list of previously uploaded files.

FileListResponse listFilesInternal(FilePurpose purpose)

Gets a list of previously uploaded files.

Response<BinaryData> listFilesInternalWithResponse(RequestOptions requestOptions)

Gets a list of previously uploaded files.

FileInfo uploadFile(UploadFileRequest body)

Uploads a file for use by other operations.

Methods inherited from java.lang.Object

Method Details

deleteFile

public void deleteFile(String fileId)

Delete a previously uploaded file.

Parameters:

fileId - The ID of the file to delete.

getFile

public FileInfo getFile(String fileId)

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.

getFileContent

public BinaryData getFileContent(String fileId)

Retrieves the raw content of a specific file.

Parameters:

fileId - The ID of the file to retrieve.

Returns:

the response.

getFileContentWithResponse

public Response<BinaryData> getFileContentWithResponse(String fileId, 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<T>.

getFileWithResponse

public Response<BinaryData> getFileWithResponse(String fileId, 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(assistants/assistants_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<T>.

listFiles

public List<FileInfo> listFiles()

Gets a list of previously uploaded files.

Returns:

a list of previously uploaded files.

listFiles

public List<FileInfo> listFiles(FilePurpose purpose)

Gets a list of previously uploaded files.

Parameters:

purpose - The purpose of the file.

Returns:

a list of previously uploaded files.

listFilesInternal

public FileListResponse listFilesInternal()

Gets a list of previously uploaded files.

Returns:

a list of previously uploaded files.

listFilesInternal

public FileListResponse listFilesInternal(FilePurpose purpose)

Gets a list of previously uploaded files.

Parameters:

purpose - The purpose of the file.

Returns:

a list of previously uploaded files.

listFilesInternalWithResponse

public Response<BinaryData> listFilesInternalWithResponse(RequestOptions requestOptions)

Gets a list of previously uploaded files.

Query Parameters

| ------- | ------ | -------- | -------------------------------------------------------------------------------------- |
| Name    | Type   | Required | Description                                                                            |
| purpose | String | No       | The purpose of the file. Allowed values: "assistants", "assistants\_output", "vision". |

You can add these to a request with RequestOptions#addQueryParam

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(assistants/assistants_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<T>.

uploadFile

public FileInfo uploadFile(UploadFileRequest body)

Uploads a file for use by other operations.

Parameters:

body - Multipart body.

Returns:

represents an agent that can call the model and use tools.

Applies to