Package com.sap.ai.sdk.grounding.client

# Class RetrievalApi

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

public class RetrievalApi 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.

- ## Field Summary

  ### Fields inherited from class com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi

  `apiClient, defaultHeaders`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RetrievalApi(com.sap.cloud.sdk.cloudplatform.connectivity.Destination httpDestination)`
  Instantiates this API class to invoke operations on the Grounding.
  `RetrievalApi(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`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DataRepositories`
  `getDataRepositories(String aiResourceGroup)`
  List all DataRepository objects.
  `DataRepositories`
  `getDataRepositories(String aiResourceGroup, Integer $top, Integer $skip, Boolean $count)`
  List all DataRepository objects.
  `DataRepository`
  `getDataRepositoryById(String aiResourceGroup, UUID repositoryId)`
  List single DataRepository object.
  `DataRepository`
  `getDataRepositoryById(String aiResourceGroup, UUID repositoryId, String remoteName)`
  List single DataRepository object.
  `RetrievalSearchResults`
  `search(String aiResourceGroup, RetrievalSearchInput retrievalSearchInput)`
  Retrieve relevant content
  `RetrievalApi`
  `withDefaultHeaders(Map<String,String> defaultHeaders)`
  Creates a new API instance with additional default headers.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### RetrievalApi

    public RetrievalApi(@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

  - ### RetrievalApi

    public RetrievalApi(@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 RetrievalApi 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

  - ### getDataRepositories

    @Nonnull public DataRepositories getDataRepositories(@Nonnull String aiResourceGroup, @Nullable Integer $top, @Nullable Integer $skip, @Nullable Boolean $count) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
    List all DataRepository objects.

    List all Data Repositories

    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:
      DataRepositories
    Throws:
      `com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException` - if an error occurs while attempting to invoke the API

  - ### getDataRepositories

    @Nonnull public DataRepositories getDataRepositories(@Nonnull String aiResourceGroup) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
    List all DataRepository objects.

    List all Data Repositories

    200 - Successful Response

    400 - The specification of the resource was incorrect

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

  - ### getDataRepositoryById

    @Nonnull public DataRepository getDataRepositoryById(@Nonnull String aiResourceGroup, @Nonnull UUID repositoryId, @Nullable String remoteName) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
    List single DataRepository object.

    List data repository by id

    200 - Successful Response

    400 - The specification of the resource was incorrect

    422 - There are validation issues with the data.

    404 - The specification of the resource was incorrect

    Parameters:
      `aiResourceGroup` - (required) Resource Group ID
      `repositoryId` - (required) Repository ID
      `remoteName` - (optional) Remote name if DataRepository is from remote DG.
    Returns:
      DataRepository
    Throws:
      `com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException` - if an error occurs while attempting to invoke the API

  - ### getDataRepositoryById

    @Nonnull public DataRepository getDataRepositoryById(@Nonnull String aiResourceGroup, @Nonnull UUID repositoryId) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
    List single DataRepository object.

    List data repository by id

    200 - Successful Response

    400 - The specification of the resource was incorrect

    422 - There are validation issues with the data.

    404 - The specification of the resource was incorrect

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

  - ### search

    @Nonnull public RetrievalSearchResults search(@Nonnull String aiResourceGroup, @Nonnull RetrievalSearchInput retrievalSearchInput) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
    Retrieve relevant content

    Retrieve relevant content given a query string.

    200 - Successful Response

    400 - The specification of the resource was incorrect

    422 - There are validation issues with the data.

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