HANAMLinVectorEngine
- class hana_ai.vectorstore.hana_vector_engine.HANAMLinVectorEngine(connection_context, table_name, schema=None, model_version='SAP_NEB.20240715')
HANA vector engine.
- Parameters:
- connection_context: ConnectionContext
Connection context.
- table_name: str
Table name.
- schema: str, optional
Schema name. Default to None.
- model_version: str, optional
Model version. Default to 'SAP_NEB.20240715'.
- Attributes:
- columns
- connection_context
- table_name
- vector_length
Methods
create_knowledge
([option])Create knowledge base.
Get knowledge dataframe.
query
(input[, top_n, distance])Query.
upsert_knowledge
(knowledge)Upsert knowledge.
- get_knowledge()
Get knowledge dataframe.
- create_knowledge(option='python')
Create knowledge base.
- Parameters:
- option: {'python', 'sql'}, optional
The option of language. Default to 'python'.
- upsert_knowledge(knowledge)
Upsert knowledge.
- Parameters:
- knowledge: dict
Knowledge data. {'id': '1', 'description': 'description', 'example': 'example'}
- query(input, top_n=1, distance='cosine_similarity')
Query.
- Parameters:
- input: str
Input text.
- top_n: int, optional
Top n. Default to 1.
- distance: str, optional
Distance. Default to 'cosine_similarity'.