Class VectorStoreFilesClient

java.lang.Object
com.azure.ai.agents.persistent.VectorStoreFilesClient

public final class VectorStoreFilesClient extends Object
Initializes a new instance of the synchronous PersistentAgentsAdministrationClient type.
  • Method Details

    • createVectorStoreFileWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> createVectorStoreFileWithResponse(String vectorStoreId, com.azure.core.util.BinaryData createVectorStoreFileRequest, com.azure.core.http.rest.RequestOptions requestOptions)
      Create a vector store file by attaching a file to a vector store.

      Request Body Schema

       
       {
           file_id: String (Optional)
           data_source (Optional): {
               uri: String (Required)
               type: String(uri_asset/id_asset) (Required)
           }
           chunking_strategy (Optional): {
               type: String(auto/static) (Required)
           }
       }
       
       

      Response Body Schema

       
       {
           id: String (Required)
           object: String (Required)
           usage_bytes: int (Required)
           created_at: long (Required)
           vector_store_id: String (Required)
           status: String(in_progress/completed/failed/cancelled) (Required)
           last_error (Required): {
               code: String(server_error/invalid_file/unsupported_file) (Required)
               message: String (Required)
           }
           chunking_strategy (Required): {
               type: String(other/static) (Required)
           }
       }
       
       
      Parameters:
      vectorStoreId - Identifier of the vector store.
      createVectorStoreFileRequest - The createVectorStoreFileRequest parameter.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      description of a file attached to a vector store 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.
    • getVectorStoreFileWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> getVectorStoreFileWithResponse(String vectorStoreId, String fileId, com.azure.core.http.rest.RequestOptions requestOptions)
      Retrieves a vector store file.

      Response Body Schema

       
       {
           id: String (Required)
           object: String (Required)
           usage_bytes: int (Required)
           created_at: long (Required)
           vector_store_id: String (Required)
           status: String(in_progress/completed/failed/cancelled) (Required)
           last_error (Required): {
               code: String(server_error/invalid_file/unsupported_file) (Required)
               message: String (Required)
           }
           chunking_strategy (Required): {
               type: String(other/static) (Required)
           }
       }
       
       
      Parameters:
      vectorStoreId - Identifier of the vector store.
      fileId - Identifier of the file.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      description of a file attached to a vector store 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.
    • deleteVectorStoreFileWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> deleteVectorStoreFileWithResponse(String vectorStoreId, String fileId, com.azure.core.http.rest.RequestOptions requestOptions)
      Deletes a vector store file. This removes the file‐to‐store link (does not delete the file itself).

      Response Body Schema

       
       {
           id: String (Required)
           deleted: boolean (Required)
           object: String (Required)
       }
       
       
      Parameters:
      vectorStoreId - Identifier of the vector store.
      fileId - Identifier of the file.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      response object for deleting a vector store file relationship 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.
    • listVectorStoreFiles

      public com.azure.core.http.rest.PagedIterable<VectorStoreFile> listVectorStoreFiles(String vectorStoreId, VectorStoreFileStatusFilter filter, Integer limit, ListSortOrder order, String after, String before)
      Returns a list of vector store files.
      Parameters:
      vectorStoreId - Identifier of the vector store.
      filter - Filter by file status.
      limit - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
      order - Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
      after - A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
      before - A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
      Returns:
      the response data for a requested list of items as paginated response with PagedIterable.
      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.
    • listVectorStoreFiles

      public com.azure.core.http.rest.PagedIterable<VectorStoreFile> listVectorStoreFiles(String vectorStoreId)
      Returns a list of vector store files.
      Parameters:
      vectorStoreId - Identifier of the vector store.
      Returns:
      the response data for a requested list of items as paginated response with PagedIterable.
      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.
    • createVectorStoreFile

      public VectorStoreFile createVectorStoreFile(String vectorStoreId, String fileId, VectorStoreDataSource dataSource, VectorStoreChunkingStrategyRequest chunkingStrategy)
      Create a vector store file by attaching a file to a vector store.
      Parameters:
      vectorStoreId - Identifier of the vector store.
      fileId - Identifier of the file.
      dataSource - Azure asset ID.
      chunkingStrategy - The chunking strategy used to chunk the file. If not set, uses the auto strategy.
      Returns:
      description of a file attached to a vector store.
      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.
    • createVectorStoreFile

      public VectorStoreFile createVectorStoreFile(String vectorStoreId)
      Create a vector store file by attaching a file to a vector store.
      Parameters:
      vectorStoreId - Identifier of the vector store.
      Returns:
      description of a file attached to a vector store.
      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.
    • getVectorStoreFile

      public VectorStoreFile getVectorStoreFile(String vectorStoreId, String fileId)
      Retrieves a vector store file.
      Parameters:
      vectorStoreId - Identifier of the vector store.
      fileId - Identifier of the file.
      Returns:
      description of a file attached to a vector store.
      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.
    • deleteVectorStoreFile

      public VectorStoreFileDeletionStatus deleteVectorStoreFile(String vectorStoreId, String fileId)
      Deletes a vector store file. This removes the file‐to‐store link (does not delete the file itself).
      Parameters:
      vectorStoreId - Identifier of the vector store.
      fileId - Identifier of the file.
      Returns:
      response object for deleting a vector store file relationship.
      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.
    • listVectorStoreFiles

      public com.azure.core.http.rest.PagedIterable<com.azure.core.util.BinaryData> listVectorStoreFiles(String vectorStoreId, com.azure.core.http.rest.RequestOptions requestOptions)
      Returns a list of vector store files.

      Query Parameters

      Query Parameters
      NameTypeRequiredDescription
      filterStringNoFilter by file status. Allowed values: "in_progress", "completed", "failed", "cancelled".
      limitIntegerNoA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
      orderStringNoSort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. Allowed values: "asc", "desc".
      afterStringNoA cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
      beforeStringNoA cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
      You can add these to a request with RequestOptions.addQueryParam(java.lang.String, java.lang.String)

      Response Body Schema

       
       {
           id: String (Required)
           object: String (Required)
           usage_bytes: int (Required)
           created_at: long (Required)
           vector_store_id: String (Required)
           status: String(in_progress/completed/failed/cancelled) (Required)
           last_error (Required): {
               code: String(server_error/invalid_file/unsupported_file) (Required)
               message: String (Required)
           }
           chunking_strategy (Required): {
               type: String(other/static) (Required)
           }
       }
       
       
      Parameters:
      vectorStoreId - Identifier of the vector store.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the response data for a requested list of items as paginated response with PagedIterable.
      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.