Skip to content

Commit

Permalink
Update base.py
Browse files Browse the repository at this point in the history
  • Loading branch information
minglu7 authored Jun 27, 2024
1 parent d51d323 commit bc122b2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def __init__(
batch_size: int = 200,
distance_strategy: Optional[DISTANCE_STRATEGIES] = "COSINE",
retrieval_strategy: Optional[AsyncRetrievalStrategy] = None,
**kwargs
) -> None:
nest_asyncio.apply()

Expand All @@ -232,12 +233,16 @@ def __init__(
distance=DistanceMetric[distance_strategy]
)

metadata_mappings = {
base_metadata_mappings = {
"document_id": {"type": "keyword"},
"doc_id": {"type": "keyword"},
"ref_doc_id": {"type": "keyword"},
}

metadata_mappings = kwargs.pop('metadata_mappings', None)
if metadata_mappings:
base_metadata_mappings.update(metadata_mappings)

self._store = AsyncVectorStore(
user_agent=get_user_agent(),
client=es_client,
Expand Down

0 comments on commit bc122b2

Please sign in to comment.