Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-markewich committed Jun 27, 2024
1 parent bc122b2 commit 1e1a232
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ def __init__(
batch_size: int = 200,
distance_strategy: Optional[DISTANCE_STRATEGIES] = "COSINE",
retrieval_strategy: Optional[AsyncRetrievalStrategy] = None,
**kwargs
metadata_mappings: Optional[Dict[str, Dict[str, str]]] = None,
**kwargs,
) -> None:
nest_asyncio.apply()

Expand All @@ -239,10 +240,9 @@ def __init__(
"ref_doc_id": {"type": "keyword"},
}

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

if metadata_mappings is not None:
metadata_mappings.update(base_metadata_mappings)

self._store = AsyncVectorStore(
user_agent=get_user_agent(),
client=es_client,
Expand Down Expand Up @@ -301,7 +301,11 @@ def add(
BulkIndexError: If AsyncElasticsearch async_bulk indexing fails.
"""
return asyncio.get_event_loop().run_until_complete(
self.async_add(nodes, create_index_if_not_exists=create_index_if_not_exists, **add_kwargs)
self.async_add(
nodes,
create_index_if_not_exists=create_index_if_not_exists,
**add_kwargs,
)
)

async def async_add(
Expand Down

0 comments on commit 1e1a232

Please sign in to comment.