Class VectorStoresClient

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

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

    • createVectorStoreWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> createVectorStoreWithResponse(com.azure.core.util.BinaryData createVectorStoreRequest, com.azure.core.http.rest.RequestOptions requestOptions)
      Creates a vector store.

      Request Body Schema

       
       {
           file_ids (Optional): [
               String (Optional)
           ]
           name: String (Optional)
           configuration (Optional): {
               data_sources (Required): [
                    (Required){
                       uri: String (Required)
                       type: String(uri_asset/id_asset) (Required)
                   }
               ]
           }
           expires_after (Optional): {
               anchor: String(last_active_at) (Required)
               days: int (Required)
           }
           chunking_strategy (Optional): {
               type: String(auto/static) (Required)
           }
           metadata (Optional): {
               String: String (Required)
           }
       }
       
       

      Response Body Schema

       
       {
           id: String (Required)
           object: String (Required)
           created_at: long (Required)
           name: String (Required)
           usage_bytes: int (Required)
           file_counts (Required): {
               in_progress: int (Required)
               completed: int (Required)
               failed: int (Required)
               cancelled: int (Required)
               total: int (Required)
           }
           status: String(expired/in_progress/completed) (Required)
           expires_after (Optional): {
               anchor: String(last_active_at) (Required)
               days: int (Required)
           }
           expires_at: Long (Optional)
           last_active_at: Long (Required)
           metadata (Required): {
               String: String (Required)
           }
       }
       
       
      Parameters:
      createVectorStoreRequest - The createVectorStoreRequest parameter.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      a vector store is a collection of processed files can be used by the `file_search` tool 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.
    • getVectorStoreWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> getVectorStoreWithResponse(String vectorStoreId, com.azure.core.http.rest.RequestOptions requestOptions)
      Returns the vector store object matching the specified ID.

      Response Body Schema

       
       {
           id: String (Required)
           object: String (Required)
           created_at: long (Required)
           name: String (Required)
           usage_bytes: int (Required)
           file_counts (Required): {
               in_progress: int (Required)
               completed: int (Required)
               failed: int (Required)
               cancelled: int (Required)
               total: int (Required)
           }
           status: String(expired/in_progress/completed) (Required)
           expires_after (Optional): {
               anchor: String(last_active_at) (Required)
               days: int (Required)
           }
           expires_at: Long (Optional)
           last_active_at: Long (Required)
           metadata (Required): {
               String: String (Required)
           }
       }
       
       
      Parameters:
      vectorStoreId - Identifier of the vector store.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      a vector store is a collection of processed files can be used by the `file_search` tool 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.
    • modifyVectorStoreWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> modifyVectorStoreWithResponse(String vectorStoreId, com.azure.core.util.BinaryData modifyVectorStoreRequest, com.azure.core.http.rest.RequestOptions requestOptions)
      Modifies an existing vector store.

      Request Body Schema

       
       {
           name: String (Optional)
           expires_after (Optional): {
               anchor: String(last_active_at) (Required)
               days: int (Required)
           }
           metadata (Optional): {
               String: String (Required)
           }
       }
       
       

      Response Body Schema

       
       {
           id: String (Required)
           object: String (Required)
           created_at: long (Required)
           name: String (Required)
           usage_bytes: int (Required)
           file_counts (Required): {
               in_progress: int (Required)
               completed: int (Required)
               failed: int (Required)
               cancelled: int (Required)
               total: int (Required)
           }
           status: String(expired/in_progress/completed) (Required)
           expires_after (Optional): {
               anchor: String(last_active_at) (Required)
               days: int (Required)
           }
           expires_at: Long (Optional)
           last_active_at: Long (Required)
           metadata (Required): {
               String: String (Required)
           }
       }
       
       
      Parameters:
      vectorStoreId - Identifier of the vector store.
      modifyVectorStoreRequest - The modifyVectorStoreRequest parameter.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      a vector store is a collection of processed files can be used by the `file_search` tool 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.
    • deleteVectorStoreWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> deleteVectorStoreWithResponse(String vectorStoreId, com.azure.core.http.rest.RequestOptions requestOptions)
      Deletes the vector store object matching the specified ID.

      Response Body Schema

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

      public com.azure.core.http.rest.PagedIterable<VectorStore> listVectorStores(Integer limit, ListSortOrder order, String after, String before)
      Returns a list of vector stores.
      Parameters:
      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.
    • listVectorStores

      public com.azure.core.http.rest.PagedIterable<VectorStore> listVectorStores()
      Returns a list of vector stores.
      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.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • createVectorStore

      public VectorStore createVectorStore(List<String> fileIds, String name, VectorStoreConfiguration storeConfiguration, VectorStoreExpirationPolicy expiresAfter, VectorStoreChunkingStrategyRequest chunkingStrategy, Map<String,String> metadata)
      Creates a vector store.
      Parameters:
      fileIds - A list of file IDs that the vector store should use. Useful for tools like `file_search` that can access files.
      name - The name of the vector store.
      storeConfiguration - The vector store configuration, used when vector store is created from Azure asset URIs.
      expiresAfter - Details on when this vector store expires.
      chunkingStrategy - The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if file_ids is non-empty.
      metadata - A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
      Returns:
      a vector store is a collection of processed files can be used by the `file_search` tool.
      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.
    • createVectorStore

      public VectorStore createVectorStore()
      Creates a vector store.
      Returns:
      a vector store is a collection of processed files can be used by the `file_search` tool.
      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.
    • getVectorStore

      public VectorStore getVectorStore(String vectorStoreId)
      Returns the vector store object matching the specified ID.
      Parameters:
      vectorStoreId - Identifier of the vector store.
      Returns:
      a vector store is a collection of processed files can be used by the `file_search` tool.
      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.
    • modifyVectorStore

      public VectorStore modifyVectorStore(String vectorStoreId, String name, VectorStoreExpirationPolicy expiresAfter, Map<String,String> metadata)
      Modifies an existing vector store.
      Parameters:
      vectorStoreId - Identifier of the vector store.
      name - The name of the vector store.
      expiresAfter - Details on when this vector store expires.
      metadata - A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
      Returns:
      a vector store is a collection of processed files can be used by the `file_search` tool.
      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.
    • modifyVectorStore

      public VectorStore modifyVectorStore(String vectorStoreId)
      Modifies an existing vector store.
      Parameters:
      vectorStoreId - Identifier of the vector store.
      Returns:
      a vector store is a collection of processed files can be used by the `file_search` tool.
      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.
    • deleteVectorStore

      public VectorStoreDeletionStatus deleteVectorStore(String vectorStoreId)
      Deletes the vector store object matching the specified ID.
      Parameters:
      vectorStoreId - Identifier of the vector store.
      Returns:
      response object for deleting 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.
    • listVectorStores

      public com.azure.core.http.rest.PagedIterable<com.azure.core.util.BinaryData> listVectorStores(com.azure.core.http.rest.RequestOptions requestOptions)
      Returns a list of vector stores.

      Query Parameters

      Query Parameters
      NameTypeRequiredDescription
      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)
           created_at: long (Required)
           name: String (Required)
           usage_bytes: int (Required)
           file_counts (Required): {
               in_progress: int (Required)
               completed: int (Required)
               failed: int (Required)
               cancelled: int (Required)
               total: int (Required)
           }
           status: String(expired/in_progress/completed) (Required)
           expires_after (Optional): {
               anchor: String(last_active_at) (Required)
               days: int (Required)
           }
           expires_at: Long (Optional)
           last_active_at: Long (Required)
           metadata (Required): {
               String: String (Required)
           }
       }
       
       
      Parameters:
      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.