Feature/astra retriever (#1741)

enable AstraDB as Retriever
This commit is contained in:
Phil Miesle 2024-04-18 14:40:36 +01:00 committed by GitHub
commit b04caf2fca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -1,5 +1,6 @@
from typing import List, Optional
from typing import List, Optional, Union
from langchain.schema import BaseRetriever
from langchain_astradb import AstraDBVectorStore
from langchain_astradb.utils.astradb import SetupMode
@ -110,7 +111,7 @@ class AstraDBVectorStoreComponent(CustomComponent):
metadata_indexing_include: Optional[List[str]] = None,
metadata_indexing_exclude: Optional[List[str]] = None,
collection_indexing_policy: Optional[dict] = None,
) -> VectorStore:
) -> Union[VectorStore, BaseRetriever]:
try:
setup_mode_value = SetupMode[setup_mode.upper()]
except KeyError:

File diff suppressed because one or more lines are too long