gen_ai_hub.orchestration.models.document_grounding
index
/home/jenkins/agent/workspace/ation_generative-ai-hub-sdk_main/gen_ai_hub/orchestration/models/document_grounding.py

 
Classes
       
builtins.str(builtins.object)
DataRepositoryType(builtins.str, enum.Enum)
GroundingType(builtins.str, enum.Enum)
enum.Enum(builtins.object)
DataRepositoryType(builtins.str, enum.Enum)
GroundingType(builtins.str, enum.Enum)
gen_ai_hub.orchestration.models.base.JSONSerializable(abc.ABC)
DocumentGrounding
DocumentGroundingFilter
DocumentMetadata
GroundingFilterSearch
GroundingModule

 
class DataRepositoryType(builtins.str, enum.Enum)
    DataRepositoryType(value, names=None, *, module=None, qualname=None, type=None, start=1)
 
Enumerates data repository types.
 
 
Method resolution order:
DataRepositoryType
builtins.str
enum.Enum
builtins.object

Data and other attributes defined here:
URL = <DataRepositoryType.URL: 'help.sap.com'>
VECTOR = <DataRepositoryType.VECTOR: 'vector'>

Data descriptors inherited from enum.Enum:
name
The name of the Enum member.
value
The value of the Enum member.

Readonly properties inherited from enum.EnumMeta:
__members__
Returns a mapping of member name->value.
 
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.

 
class DocumentGrounding(gen_ai_hub.orchestration.models.base.JSONSerializable)
    DocumentGrounding(input_params: List[str], output_param: str, filters: List[gen_ai_hub.orchestration.models.document_grounding.DocumentGroundingFilter] = None, metadata_params: List[str] = None)
 
defines the detailed configuration for the Grounding module.
 
 
Method resolution order:
DocumentGrounding
gen_ai_hub.orchestration.models.base.JSONSerializable
abc.ABC
builtins.object

Methods defined here:
__init__(self, input_params: List[str], output_param: str, filters: List[gen_ai_hub.orchestration.models.document_grounding.DocumentGroundingFilter] = None, metadata_params: List[str] = None)
Initializes the DocumentGrounding instance.
 
:param input_params: The list of input parameters used for grounding input questions.
:type input_params: List[str]
:param output_param: Parameter name used for grounding output.
:type output_param: str
:param filters: List of DocumentGroundingFilter objects, defaults to None
:type filters: List[DocumentGroundingFilter], optional
:param metadata_params: Parameter name used for specifying metadata parameters, defaults to None
:type metadata_params: List[str], optional
to_dict(self)
Converts the DocumentGrounding instance to a dictionary representation.
 
:return: Dictionary representation of the DocumentGrounding.
:rtype: dict

Data and other attributes defined here:
__abstractmethods__ = frozenset()
__annotations__ = {}

Data descriptors inherited from gen_ai_hub.orchestration.models.base.JSONSerializable:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class DocumentGroundingFilter(gen_ai_hub.orchestration.models.base.JSONSerializable)
    DocumentGroundingFilter(id: str, data_repository_type: str, search_config: gen_ai_hub.orchestration.models.document_grounding.GroundingFilterSearch = None, data_repositories: List[str] = None, data_repository_metadata: List[Dict[str, Any]] = None, document_metadata: List[gen_ai_hub.orchestration.models.document_grounding.DocumentMetadata] = None, chunk_metadata: List[Dict[str, Any]] = None)
 
Module for configuring document grounding filters.
 
 
Method resolution order:
DocumentGroundingFilter
gen_ai_hub.orchestration.models.base.JSONSerializable
abc.ABC
builtins.object

Methods defined here:
__init__(self, id: str, data_repository_type: str, search_config: gen_ai_hub.orchestration.models.document_grounding.GroundingFilterSearch = None, data_repositories: List[str] = None, data_repository_metadata: List[Dict[str, Any]] = None, document_metadata: List[gen_ai_hub.orchestration.models.document_grounding.DocumentMetadata] = None, chunk_metadata: List[Dict[str, Any]] = None)
Initializes the DocumentGroundingFilter instance.
 
:param id: The unique identifier for the grounding filter.
:type id: str
:param data_repository_type: Only include DataRepositories with the given type:
    'vector' or 'url' of website supporting elastic search.
:type data_repository_type: str
:param search_config: GroundingFilterSearchConfiguration object, defaults to None
:type search_config: GroundingFilterSearch, optional
:param data_repositories: list of data repositories to search.
    Specify ['*'] to search across all DataRepositories or
    give a specific list of DataRepository ids, defaults to None
:type data_repositories: List[str], optional
:param data_repository_metadata: The metadata for the data repository,
    Restrict DataRepositories considered during search to those annotated with the given
    metadata. Useful when combined with dataRepositories=['*'], defaults to None
:type data_repository_metadata: List[Dict[str, Any]], optional
:param document_metadata: DocumentMetadata object, defaults to None
:type document_metadata: List[DocumentMetadata], optional
:param chunk_metadata: Restrict chunks considered during search to those with the given metadata, 
    defaults to None
:type chunk_metadata: List[Dict[str, Any]], optional
to_dict(self)
Converts the DocumentGroundingFilter instance to a dictionary representation.
 
:return: Dictionary representation of the DocumentGroundingFilter.
:rtype: dict

Data and other attributes defined here:
__abstractmethods__ = frozenset()
__annotations__ = {}

Data descriptors inherited from gen_ai_hub.orchestration.models.base.JSONSerializable:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class DocumentMetadata(gen_ai_hub.orchestration.models.base.JSONSerializable)
    DocumentMetadata(key: str, value: List[str], select_mode: List[str] = None)
 
Restrict documents considered during search to those annotated with the given metadata.
 
 
Method resolution order:
DocumentMetadata
gen_ai_hub.orchestration.models.base.JSONSerializable
abc.ABC
builtins.object

Methods defined here:
__init__(self, key: str, value: List[str], select_mode: List[str] = None)
Initializes the DocumentMetadata instance.
 
:param key: The key for the metadata.
:type key: str
:param value: The list of values for the metadata.
:type value: List[str]
:param select_mode: Select mode for search filters.
:type select_mode: List[str], optional
to_dict(self)
Converts the DocumentMetadata instance to a dictionary representation.
 
:return: Dictionary representation of the DocumentMetadata.
:rtype: dict

Data and other attributes defined here:
__abstractmethods__ = frozenset()
__annotations__ = {}

Data descriptors inherited from gen_ai_hub.orchestration.models.base.JSONSerializable:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class GroundingFilterSearch(gen_ai_hub.orchestration.models.base.JSONSerializable)
    GroundingFilterSearch(max_chunk_count: int = None, max_document_count: int = None)
 
Search configuration for the data repository.
 
 
Method resolution order:
GroundingFilterSearch
gen_ai_hub.orchestration.models.base.JSONSerializable
abc.ABC
builtins.object

Methods defined here:
__init__(self, max_chunk_count: int = None, max_document_count: int = None)
Initializes the GroundingFilterSearch instance.
 
:param max_chunk_count: maximum number of chunks > 0 to return, defaults to None
:type max_chunk_count: int, optional
:param max_document_count: Maximum number of documents > 0 to return.
    Only supports 'vector' dataRepositoryType. Cannot be used with 'maxChunkCount'.
    If maxDocumentCount is given, then only one chunk per document is returned, defaults to None
:type max_document_count: int, optional
:raises ValueError: If both max_chunk_count and max_document_count are set.
to_dict(self)
Converts the GroundingFilterSearch instance to a dictionary representation.
 
:return: Dictionary representation of the GroundingFilterSearch.
:rtype: dict

Data and other attributes defined here:
__abstractmethods__ = frozenset()
__annotations__ = {}

Data descriptors inherited from gen_ai_hub.orchestration.models.base.JSONSerializable:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class GroundingModule(gen_ai_hub.orchestration.models.base.JSONSerializable)
    GroundingModule(type: str, config: gen_ai_hub.orchestration.models.document_grounding.DocumentGrounding)
 
Module for managing and applying grounding aka RAG configurations.
 
 
Method resolution order:
GroundingModule
gen_ai_hub.orchestration.models.base.JSONSerializable
abc.ABC
builtins.object

Methods defined here:
__init__(self, type: str, config: gen_ai_hub.orchestration.models.document_grounding.DocumentGrounding)
Initializes the GroundingModule instance.
 
:param type: The type of the grounding module.
:type type: str
:param config: Configuration for the grounding module.
:type config: DocumentGrounding
to_dict(self)
Converts the GroundingModule instance to a dictionary representation.
 
:return: Dictionary representation of the GroundingModule.
:rtype: dict

Data and other attributes defined here:
__abstractmethods__ = frozenset()
__annotations__ = {}

Data descriptors inherited from gen_ai_hub.orchestration.models.base.JSONSerializable:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class GroundingType(builtins.str, enum.Enum)
    GroundingType(value, names=None, *, module=None, qualname=None, type=None, start=1)
 
Enumerates supported grounding types.
 
 
Method resolution order:
GroundingType
builtins.str
enum.Enum
builtins.object

Data and other attributes defined here:
DOCUMENT_GROUNDING_SERVICE = <GroundingType.DOCUMENT_GROUNDING_SERVICE: 'document_grounding_service'>

Data descriptors inherited from enum.Enum:
name
The name of the Enum member.
value
The value of the Enum member.

Readonly properties inherited from enum.EnumMeta:
__members__
Returns a mapping of member name->value.
 
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.

 
Data
        Any = typing.Any
Dict = typing.Dict
List = typing.List