Class VectorApi
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.
-
Field Summary
Fields inherited from class com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi
apiClient, defaultHeaders -
Constructor Summary
ConstructorsConstructorDescriptionVectorApi(com.sap.cloud.sdk.cloudplatform.connectivity.Destination httpDestination) Instantiates this API class to invoke operations on the Grounding.VectorApi(com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient apiClient) Instantiates this API class to invoke operations on the Grounding based on a givenApiClient. -
Method Summary
Modifier and TypeMethodDescriptioncom.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponsecreateCollection(String aiResourceGroup, CollectionRequest collectionRequest) Create collectioncreateDocuments(String aiResourceGroup, UUID collectionId, DocumentCreateRequest documentCreateRequest) Create documents in collectiondeleteAllDocuments(String aiResourceGroup, DocumentBulkDeleteRequest documentBulkDeleteRequest) Delete list of documents across collectionscom.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponsedeleteCollectionById(String aiResourceGroup, String collectionId) Delete collection by IDcom.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponsedeleteDocumentById(String aiResourceGroup, UUID collectionId, UUID documentId) Delete a documentgetAllCollections(String aiResourceGroup) Get collectionsgetAllCollections(String aiResourceGroup, Integer $top, Integer $skip, Boolean $count) Get collectionsgetAllDocuments(String aiResourceGroup, UUID collectionId) Get documentsgetAllDocuments(String aiResourceGroup, UUID collectionId, Integer $top, Integer $skip, Boolean $count) Get documentsgetCollectionById(String aiResourceGroup, UUID collectionId) Get collection by IDgetCollectionCreationStatus(String aiResourceGroup, UUID id) Get collection status by IDgetCollectionDeletionStatus(String aiResourceGroup, UUID id) Get collection status by IDgetDocumentById(String aiResourceGroup, UUID collectionId, UUID documentId) Get document by IDsearch(String aiResourceGroup, TextSearchRequest textSearchRequest) Search chunk by vectorupdateChunksMetadata(String aiResourceGroup, MetadataUpdates metadataUpdates) Patch chunks metadataupdateCollectionsMetadata(String aiResourceGroup, MetadataUpdates metadataUpdates) Patch collections metadataupdateDocuments(String aiResourceGroup, UUID collectionId, DocumentUpdateRequest documentUpdateRequest) Upsert documents in collectionupdateDocumentsMetadata(String aiResourceGroup, MetadataUpdates metadataUpdates) Patch documents metadatawithDefaultHeaders(Map<String, String> defaultHeaders) Creates a new API instance with additional default headers.
-
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 givenApiClient.- Parameters:
apiClient- ApiClient to invoke the API on
-
-
Method Details
-
withDefaultHeaders
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 collectionCreates 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 IDcollectionRequest- 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 collectionCreate 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 IDcollectionId- Collection IDdocumentCreateRequest- 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 collectionsDeletes 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 IDdocumentBulkDeleteRequest- 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 IDDeletes 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 IDcollectionId- 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 documentDeletes 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 IDcollectionId- Collection IDdocumentId- 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 collectionsGets 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 collectionsGets 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 documentsGets 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 IDcollectionId- (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 documentsGets 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 IDcollectionId- 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 IDGets 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 IDcollectionId- 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 IDGets 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 IDid- 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 IDGets 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 IDid- 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 IDGets 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 IDcollectionId- Collection IDdocumentId- 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 vectorSearch 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 IDtextSearchRequest- 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 metadataAllows 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 IDmetadataUpdates- 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 metadataAllows 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 IDmetadataUpdates- 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 collectionUpserts 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 IDcollectionId- Collection IDdocumentUpdateRequest- 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 metadataAllows 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 IDmetadataUpdates- 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
-