ahvn.adapter.vdb module¶
- class ahvn.adapter.vdb.VdbUKFAdapter(backend=None, *args, **kwargs)[源代码]¶
-
Vector database adapter that provides logical conversion between UKF objects and vector database records.
This adapter creates field type mappings dynamically based on the included fields and provides conversion methods between UKF objects and LlamaIndex TextNode objects. Does not handle any physical connection operations - those are managed by VectorDatabase.
- virtual_fields = ('id', 'expiration_timestamp')¶
- __init__(backend=None, *args, **kwargs)[源代码]¶
Initialize the vector adapter with specified field inclusion.
- 参数:
name -- Name of the adapter instance.
include -- List of BaseUKF field names to include in the vector database schema. If None, includes all available BaseUKF fields plus virtual fields. The 'id' field is always included automatically.
exclude -- List of BaseUKF field names to exclude from the vector database schema. If None, excludes no fields.
backend -- Vector database backend ('lancedb', 'chroma', 'milvuslite', etc.). Used for backend-aware type conversions.
*args -- Additional positional arguments.
**kwargs -- Additional configuration parameters.
- 返回:
None
- from_ukf(kl, key=None, embedding=None)[源代码]¶
Convert a BaseUKF object to a LlamaIndex TextNode.
- 参数:
- 返回类型:
TextNode- 返回:
LlamaIndex TextNode object representing the UKF data.