gen_ai_hub.document_grounding.clients.retrieval_api_client
index
/home/jenkins/agent/workspace/ation_generative-ai-hub-sdk_main/gen_ai_hub/document_grounding/clients/retrieval_api_client.py

Retrieval API client for Document Grounding.
 
This module provides the RetrievalAPIClient class for querying and retrieving
relevant content from configured data repositories. The Retrieval API combines
semantic search with repository metadata filtering and supports custom retrieval
configurations for chunk/document granularity.
 
Supported repository types:
    - Vector stores
    - External document sources (e.g., help.sap.com)
 
API Reference: https://api.sap.com/api/DOCUMENT_GROUNDING_API/resource/Retrieval

 
Modules
       
humps

 
Classes
       
builtins.object
RetrievalAPIClient

 
class RetrievalAPIClient(builtins.object)
    RetrievalAPIClient(proxy_client: Optional[gen_ai_hub.proxy.gen_ai_hub_proxy.client.GenAIHubProxyClient] = None)
 
The Retrieval API enables querying and retrieving relevant content from configured data repositories,
such as vector or external document sources (e.g., help.sap.com).
 
Retrieval combines semantic search with repository metadata filtering and supports custom
retrieval configurations for chunk/document granularity.
 
Reference: https://api.sap.com/api/DOCUMENT_GROUNDING_API/resource/Retrieval
 
  Methods defined here:
__init__(self, proxy_client: Optional[gen_ai_hub.proxy.gen_ai_hub_proxy.client.GenAIHubProxyClient] = None)
Initialize the RetrievalAPIClient.
 
:param proxy_client: Optional proxy client for making API requests.
:type proxy_client: Optional[GenAIHubProxyClient], optional
get_data_repositories(self, top: Optional[int] = None, skip: Optional[int] = None, count: Optional[bool] = None) -> gen_ai_hub.document_grounding.models.retrieval.DataRepositories
List all data repositories available to the tenant.
 
:param top: the number of items to return, defaults to None
:type top: Optional[int], optional
:param skip: the number of items to skip, defaults to None
:type skip: Optional[int], optional
:param count: whether to include a count of total items, defaults to None
:type count: Optional[bool], optional
:return: DataRepositories model containing the list of data repositories
:rtype: DataRepositories
get_data_repository_by_id(self, repository_id: str) -> gen_ai_hub.document_grounding.models.retrieval.DataRepository
Get a single data repository by its unique ID.
 
:param repository_id: the unique identifier of the data repository
:type repository_id: str
:return: DataRepository model representing the data repository
:rtype: DataRepository
search(self, search_input: gen_ai_hub.document_grounding.models.retrieval.RetrievalSearchInput) -> gen_ai_hub.document_grounding.models.retrieval.RetrievalSearchResults
Perform a retrieval search for relevant content.
 
:param search_input: RetrievalSearchInput model defining the query and filters.
:type search_input: RetrievalSearchInput
:return: RetrievalSearchResults model containing repositories, documents, and chunks.
:rtype: RetrievalSearchResults

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        Optional = typing.Optional
PATH_DOCUMENT_GROUNDING_RETRIEVAL = '/lm/document-grounding/retrieval'