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

Pipeline API client for Document Grounding.
 
This module provides the PipelineAPIClient class for managing document vectorization
pipelines. Pipelines automate the process of fetching documents from data repositories,
preprocessing and chunking content, generating semantic embeddings, and storing them
in HANA Vector Store.
 
Supported data repositories:
    - Microsoft SharePoint
    - AWS S3
    - SFTP
 
API Reference: https://api.sap.com/api/DOCUMENT_GROUNDING_API/resource/Pipelines

 
Modules
       
humps
requests

 
Classes
       
builtins.object
PipelineAPIClient

 
class PipelineAPIClient(builtins.object)
    PipelineAPIClient(proxy_client: Optional[gen_ai_hub.proxy.gen_ai_hub_proxy.client.GenAIHubProxyClient] = None)
 
The Pipelines API creates and manages vector stores based on documents from user data repositories:
S3, SFTP, and Microsoft SharePoint.
Each pipeline represents a configured end-to-end process including the following steps:
 
- Fetches documents from a supported data source
 
- Preprocesses and chunks the document content, and generates semantic embeddings. 
  Semantic embeddings are multidimensional representations of textual information.
 
- Stores semantic embeddings into the HANA Vector Store
 
 
The Pipeline API is compatible with the following data repositories:
 
- Microsoft SharePoint
 
- AWS S3
 
- SFTP
 
See https://api.sap.com/api/DOCUMENT_GROUNDING_API/resource/Pipelines
 
  Methods defined here:
__init__(self, proxy_client: Optional[gen_ai_hub.proxy.gen_ai_hub_proxy.client.GenAIHubProxyClient] = None)
Initializes the PipelineAPIClient
 
:param proxy_client: proxy client to use for requests, defaults to None
:type proxy_client: Optional[GenAIHubProxyClient], optional
create_pipeline(self, pipeline_request: Union[gen_ai_hub.document_grounding.models.pipeline.MSSharePointPipelineCreateRequest, gen_ai_hub.document_grounding.models.pipeline.S3PipelineCreateRequest, gen_ai_hub.document_grounding.models.pipeline.SFTPPipelineCreateRequest]) -> gen_ai_hub.document_grounding.models.pipeline.PipelineIdResponse
Create a document vectorization pipeline
 
:param pipeline_request: The object containing the pipeline configuration.
:type pipeline_request: CreatePipelineRequest
:return: ID of the created pipeline
:rtype: PipelineIdResponse
delete_pipeline_by_id(self, pipeline_id: str) -> requests.models.Response
Delete a pipeline by pipeline id
 
:param pipeline_id: ID of the pipeline to delete
:type pipeline_id: str
:return: Response of the delete operation
:rtype: requests.Response
get_execution_document_by_id(self, pipeline_id: str, execution_id: str, document_id: str) -> gen_ai_hub.document_grounding.models.pipeline.Document
Get Document by ID for a Pipeline Execution
 
:return: Document for the Pipeline Execution
:rtype: Document
get_execution_documents(self, pipeline_id: str, execution_id: str, top: Optional[int] = None, skip: Optional[int] = None, count: Optional[bool] = None) -> gen_ai_hub.document_grounding.models.pipeline.DocumentsStatusResponse
Get Documents for a Pipeline Execution
 
:param pipeline_id: Pipeline ID
:type pipeline_id: str
:param execution_id: Execution ID
:type execution_id: str
:param top: the maximum number of documents to return, defaults to None
:type top: Optional[int], optional
:param skip: number of documents to skip, defaults to None
:type skip: Optional[int], optional
:param count: flag to include count of total documents, defaults to None
:type count: Optional[bool], optional
:return: Documents for the Pipeline Execution
:rtype: DocumentsStatusResponse
get_pipeline_by_id(self, pipeline_id: str) -> gen_ai_hub.document_grounding.models.pipeline.BasePipelineResponse
Get details of a pipeline by pipeline id.
 
:param pipeline_id: Pipeline ID
:type pipeline_id: str
:return: Details of the pipeline
:rtype: BasePipelineResponse
get_pipeline_document_by_id(self, pipeline_id: str, document_id: str) -> gen_ai_hub.document_grounding.models.pipeline.Document
Get Document by ID for a Pipeline
 
:param pipeline_id: Pipeline ID
:type pipeline_id: str
:param document_id: Document ID
:type document_id: str
:return: Document for the Pipeline
:rtype: Document
get_pipeline_documents(self, pipeline_id: str, top: Optional[int] = None, skip: Optional[int] = None, count: Optional[bool] = None) -> gen_ai_hub.document_grounding.models.pipeline.DocumentsStatusResponse
Get Documents for a Pipeline
 
:param pipeline_id: Pipeline ID
:type pipeline_id: str
:param top: the maximum number of documents to return, defaults to None
:type top: Optional[int], optional
:param skip: number of documents to skip, defaults to None
:type skip: Optional[int], optional
:param count: flag to include count of total documents, defaults to None
:type count: Optional[bool], optional
:return: Documents for the Pipeline
:rtype: DocumentsStatusResponse
get_pipeline_execution_by_id(self, pipeline_id: str, execution_id: str) -> gen_ai_hub.document_grounding.models.pipeline.PipelineExecution
Get Pipeline Execution by ID
 
:param pipeline_id: Pipeline ID
:type pipeline_id: str
:param execution_id: Execution ID
:type execution_id: str
:return: Pipeline Execution
:rtype: PipelineExecution
get_pipeline_executions(self, pipeline_id: str, last_execution: Optional[bool] = None, top: Optional[int] = None, skip: Optional[int] = None, count: Optional[bool] = None) -> gen_ai_hub.document_grounding.models.pipeline.GetPipelineExecutionsResponse
Get Pipeline Executions
 
:param pipeline_id: Pipeline ID
:type pipeline_id: str
:param last_execution: flag to get only the last execution, defaults to None
:type last_execution: Optional[bool], optional
:param top: number of executions to retrieve, defaults to None
:type top: Optional[int], optional
:param skip: number of executions to skip, defaults to None
:type skip: Optional[int], optional
:param count: flag to include count of total executions, defaults to None
:type count: Optional[bool], optional
:return: Pipeline Executions
:rtype: GetPipelineExecutionsResponse
get_pipeline_status(self, pipeline_id: str) -> gen_ai_hub.document_grounding.models.pipeline.GetPipelineStatusResponse
Get pipeline status by pipeline id
 
:param pipeline_id: Pipeline ID
:type pipeline_id: str
:return: Status of the pipeline
:rtype: GetPipelineStatusResponse
get_pipelines(self, top: Optional[int] = None, skip: Optional[int] = None, count: Optional[bool] = None) -> gen_ai_hub.document_grounding.models.pipeline.GetPipelinesResponse
Get all pipelines.
 
:return: Get all pipelines
:rtype: GetPipelinesResponse
search_pipelines(self, body: gen_ai_hub.document_grounding.models.pipeline.SearchPipelineRequest) -> gen_ai_hub.document_grounding.models.pipeline.SearchPipelinesResponse
Pipeline Search by Metadata
 
:param body: The search request object containing metadata filters.
:type body: SearchPipelineRequest
:return: Search results containing matching pipelines.
:rtype: SearchPipelinesResponse
trigger_pipeline(self, request: gen_ai_hub.document_grounding.models.pipeline.ManualPipelineTrigger) -> requests.models.Response
Trigger Pipeline Manually
 
:param request: The manual trigger request object.
:type request: ManualPipelineTrigger
:return: Response of the trigger operation
:rtype: requests.Response

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

 
Data
        CreatePipelineRequest = typing.Union[gen_ai_hub.document_grounding.model...unding.models.pipeline.SFTPPipelineCreateRequest]
Optional = typing.Optional
PATH_DOCUMENT_GROUNDING = '/lm/document-grounding/pipelines'
PATH_DOCUMENT_GROUNDING_PIPELINES = '/lm/document-grounding/pipelines'