Class VectorApi

java.lang.Object
com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi
com.sap.ai.sdk.grounding.client.VectorApi

public class VectorApi extends com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi
Grounding in version 0.1.0.

Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions.

  • Constructor Details

    • VectorApi

      public VectorApi(@Nonnull com.sap.cloud.sdk.cloudplatform.connectivity.Destination httpDestination)
      Instantiates this API class to invoke operations on the Grounding.
      Parameters:
      httpDestination - The destination that API should be used with
    • VectorApi

      public VectorApi(@Nonnull com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient apiClient)
      Instantiates this API class to invoke operations on the Grounding based on a given ApiClient.
      Parameters:
      apiClient - ApiClient to invoke the API on
  • Method Details

    • withDefaultHeaders

      public VectorApi withDefaultHeaders(@Nonnull Map<String,String> defaultHeaders)
      Creates a new API instance with additional default headers.
      Parameters:
      defaultHeaders - Additional headers to include in all requests
      Returns:
      A new API instance with the combined headers
    • createCollection

      @Nonnull public com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponse createCollection(@Nonnull String aiResourceGroup, @Nonnull CollectionRequest collectionRequest) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Create collection

      Creates a collection. This operation is asynchronous. Poll the collection resource and check the status field to understand creation status.

      202 - Successful Response

      400 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      collectionRequest - The value for the parameter collectionRequest
      Returns:
      An OpenApiResponse containing the status code of the HttpResponse.
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • createDocuments

      @Nonnull public DocumentsListResponse createDocuments(@Nonnull String aiResourceGroup, @Nonnull UUID collectionId, @Nonnull DocumentCreateRequest documentCreateRequest) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Create documents in collection

      Create and stores one or multiple documents into a collection. If omitted, 'id' will be auto-generated.

      201 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      collectionId - Collection ID
      documentCreateRequest - The value for the parameter documentCreateRequest
      Returns:
      DocumentsListResponse
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • deleteAllDocuments

      @Nonnull public DocumentBulkDeleteResponse deleteAllDocuments(@Nonnull String aiResourceGroup, @Nonnull DocumentBulkDeleteRequest documentBulkDeleteRequest) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Delete list of documents across collections

      Deletes list of documents across collections.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      documentBulkDeleteRequest - The value for the parameter documentBulkDeleteRequest
      Returns:
      DocumentBulkDeleteResponse
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • deleteCollectionById

      @Nonnull public com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponse deleteCollectionById(@Nonnull String aiResourceGroup, @Nonnull String collectionId) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Delete collection by ID

      Deletes a specific collection by ID. This operation is asynchronous. Poll the collection for a 404 status code.

      202 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      collectionId - Collection ID
      Returns:
      An OpenApiResponse containing the status code of the HttpResponse.
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • deleteDocumentById

      @Nonnull public com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponse deleteDocumentById(@Nonnull String aiResourceGroup, @Nonnull UUID collectionId, @Nonnull UUID documentId) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Delete a document

      Deletes a specific document of a collection.

      204 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      collectionId - Collection ID
      documentId - Document ID
      Returns:
      An OpenApiResponse containing the status code of the HttpResponse.
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • getAllCollections

      @Nonnull public CollectionsListResponse getAllCollections(@Nonnull String aiResourceGroup, @Nullable Integer $top, @Nullable Integer $skip, @Nullable Boolean $count) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Get collections

      Gets a list of collections.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      Parameters:
      aiResourceGroup - (required) Resource Group ID
      $top - (optional) Number of results to display
      $skip - (optional) Number of results to be skipped from the ordered list of results
      $count - (optional) When the $count field is set to false, the response contains a count of the items present in the response. When the $count field is set to true, the response contains a count of all the items present on the server, and not just the ones in the response. When the $count field is not passed, it is false by default.
      Returns:
      CollectionsListResponse
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • getAllCollections

      @Nonnull public CollectionsListResponse getAllCollections(@Nonnull String aiResourceGroup) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Get collections

      Gets a list of collections.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      Parameters:
      aiResourceGroup - Resource Group ID
      Returns:
      CollectionsListResponse
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • getAllDocuments

      @Nonnull public Documents getAllDocuments(@Nonnull String aiResourceGroup, @Nonnull UUID collectionId, @Nullable Integer $top, @Nullable Integer $skip, @Nullable Boolean $count) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Get documents

      Gets a list of documents of a collection.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - (required) Resource Group ID
      collectionId - (required) Collection ID
      $top - (optional) Number of results to display
      $skip - (optional) Number of results to be skipped from the ordered list of results
      $count - (optional) When the $count field is set to false, the response contains a count of the items present in the response. When the $count field is set to true, the response contains a count of all the items present on the server, and not just the ones in the response. When the $count field is not passed, it is false by default.
      Returns:
      Documents
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • getAllDocuments

      @Nonnull public Documents getAllDocuments(@Nonnull String aiResourceGroup, @Nonnull UUID collectionId) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Get documents

      Gets a list of documents of a collection.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      collectionId - Collection ID
      Returns:
      Documents
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • getCollectionById

      @Nonnull public Collection getCollectionById(@Nonnull String aiResourceGroup, @Nonnull UUID collectionId) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Get collection by ID

      Gets a specific collection by ID.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      collectionId - Collection ID
      Returns:
      Collection
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • getCollectionCreationStatus

      @Nonnull public VectorV1VectorEndpointsGetCollectionCreationStatus200Response getCollectionCreationStatus(@Nonnull String aiResourceGroup, @Nonnull UUID id) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Get collection status by ID

      Gets a specific collection status from monitor by ID.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      id - Collection ID
      Returns:
      VectorV1VectorEndpointsGetCollectionCreationStatus200Response
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • getCollectionDeletionStatus

      @Nonnull public VectorV1VectorEndpointsGetCollectionDeletionStatus200Response getCollectionDeletionStatus(@Nonnull String aiResourceGroup, @Nonnull UUID id) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Get collection status by ID

      Gets a specific collection status from monitor by ID.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      id - Collection ID
      Returns:
      VectorV1VectorEndpointsGetCollectionDeletionStatus200Response
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • getDocumentById

      @Nonnull public DocumentResponse getDocumentById(@Nonnull String aiResourceGroup, @Nonnull UUID collectionId, @Nonnull UUID documentId) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Get document by ID

      Gets a specific document in a collection by ID.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      collectionId - Collection ID
      documentId - Document ID
      Returns:
      DocumentResponse
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • search

      @Nonnull public VectorSearchResults search(@Nonnull String aiResourceGroup, @Nonnull TextSearchRequest textSearchRequest) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Search chunk by vector

      Search chunks

      200 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      textSearchRequest - The value for the parameter textSearchRequest
      Returns:
      VectorSearchResults
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • updateChunksMetadata

      @Nonnull public MetadataResponse updateChunksMetadata(@Nonnull String aiResourceGroup, @Nonnull MetadataUpdates metadataUpdates) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Patch chunks metadata

      Allows to add, remove and modify the chunks metadata.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      metadataUpdates - The value for the parameter metadataUpdates
      Returns:
      MetadataResponse
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • updateCollectionsMetadata

      @Nonnull public MetadataResponse updateCollectionsMetadata(@Nonnull String aiResourceGroup, @Nonnull MetadataUpdates metadataUpdates) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Patch collections metadata

      Allows to add, remove and modify the collections metadata.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      metadataUpdates - The value for the parameter metadataUpdates
      Returns:
      MetadataResponse
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • updateDocuments

      @Nonnull public DocumentsListResponse updateDocuments(@Nonnull String aiResourceGroup, @Nonnull UUID collectionId, @Nonnull DocumentUpdateRequest documentUpdateRequest) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Upsert documents in collection

      Upserts the data of multiple documents into a collection.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      collectionId - Collection ID
      documentUpdateRequest - The value for the parameter documentUpdateRequest
      Returns:
      DocumentsListResponse
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API
    • updateDocumentsMetadata

      @Nonnull public MetadataResponse updateDocumentsMetadata(@Nonnull String aiResourceGroup, @Nonnull MetadataUpdates metadataUpdates) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
      Patch documents metadata

      Allows to add, remove and modify the documents metadata.

      200 - Successful Response

      400 - The specification of the resource was incorrect

      404 - The specification of the resource was incorrect

      422 - There are validation issues with the data.

      Parameters:
      aiResourceGroup - Resource Group ID
      metadataUpdates - The value for the parameter metadataUpdates
      Returns:
      MetadataResponse
      Throws:
      com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException - if an error occurs while attempting to invoke the API