Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async support #53

Merged
merged 11 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libs/elasticsearch/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ spell_fix:
check_imports: $(shell find langchain_elasticsearch -name '*.py')
poetry run python ./scripts/check_imports.py $^

run_unasync:
poetry run python ./scripts/run_unasync.py

run_unasync_check:
poetry run python ./scripts/run_unasync.py --check

######################
# HELP
######################
Expand Down
34 changes: 31 additions & 3 deletions libs/elasticsearch/langchain_elasticsearch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from elasticsearch.helpers.vectorstore import (
AsyncBM25Strategy,
AsyncDenseVectorScriptScoreStrategy,
AsyncDenseVectorStrategy,
AsyncRetrievalStrategy,
AsyncSparseVectorStrategy,
BM25Strategy,
DenseVectorScriptScoreStrategy,
DenseVectorStrategy,
Expand All @@ -8,28 +13,51 @@
)

from langchain_elasticsearch.cache import (
AsyncElasticsearchCache,
AsyncElasticsearchEmbeddingsCache,
ElasticsearchCache,
ElasticsearchEmbeddingsCache,
)
from langchain_elasticsearch.chat_history import ElasticsearchChatMessageHistory
from langchain_elasticsearch.embeddings import ElasticsearchEmbeddings
from langchain_elasticsearch.retrievers import ElasticsearchRetriever
from langchain_elasticsearch.chat_history import (
AsyncElasticsearchChatMessageHistory,
ElasticsearchChatMessageHistory,
)
from langchain_elasticsearch.embeddings import (
AsyncElasticsearchEmbeddings,
ElasticsearchEmbeddings,
)
from langchain_elasticsearch.retrievers import (
AsyncElasticsearchRetriever,
ElasticsearchRetriever,
)
from langchain_elasticsearch.vectorstores import (
ApproxRetrievalStrategy,
AsyncElasticsearchStore,
BM25RetrievalStrategy,
ElasticsearchStore,
ExactRetrievalStrategy,
SparseRetrievalStrategy,
)

__all__ = [
"AsyncElasticsearchCache",
"AsyncElasticsearchChatMessageHistory",
"AsyncElasticsearchEmbeddings",
"AsyncElasticsearchEmbeddingsCache",
"AsyncElasticsearchRetriever",
"AsyncElasticsearchStore",
"ElasticsearchCache",
"ElasticsearchChatMessageHistory",
"ElasticsearchEmbeddings",
"ElasticsearchEmbeddingsCache",
"ElasticsearchRetriever",
"ElasticsearchStore",
# retrieval strategies
"AsyncBM25Strategy",
"AsyncDenseVectorScriptScoreStrategy",
"AsyncDenseVectorStrategy",
"AsyncRetrievalStrategy",
"AsyncSparseVectorStrategy",
"BM25Strategy",
"DenseVectorScriptScoreStrategy",
"DenseVectorStrategy",
Expand Down
Loading
Loading