diff --git a/application/requirements.txt b/application/requirements.txt index 2a6926dd..2430a787 100644 --- a/application/requirements.txt +++ b/application/requirements.txt @@ -6,19 +6,15 @@ dataclasses-json==0.6.7 docx2txt==0.8 duckduckgo-search==7.5.2 ebooklib==0.18 -elastic-transport==8.17.0 -elasticsearch==8.17.1 escodegen==1.0.11 esprima==4.0.1 esutils==1.0.1 -Flask==3.1.0 +Flask==3.1.1 faiss-cpu==1.9.0.post1 flask-restx==1.3.0 google-genai==1.3.0 -google-generativeai==0.8.5 gTTS==2.5.4 gunicorn==23.0.0 -html2text==2024.2.26 javalang==0.13.0 jinja2==3.1.6 jiter==0.8.2 @@ -52,8 +48,7 @@ pathable==0.4.4 pillow==11.1.0 portalocker==3.1.1 prance==23.6.21.0 -primp==0.14.0 -prompt-toolkit==3.0.50 +prompt-toolkit==3.0.51 protobuf==5.29.3 psycopg2-binary==2.9.10 py==1.11.0 @@ -84,7 +79,7 @@ urllib3==2.3.0 vine==5.1.0 wcwidth==0.2.13 werkzeug==3.1.3 -yarl==1.18.3 +yarl==1.20.0 markdownify==0.14.1 tldextract==5.1.3 websockets==14.1 diff --git a/application/vectorstore/elasticsearch.py b/application/vectorstore/elasticsearch.py index e393e4a5..dfa0314f 100644 --- a/application/vectorstore/elasticsearch.py +++ b/application/vectorstore/elasticsearch.py @@ -1,9 +1,6 @@ from application.vectorstore.base import BaseVectorStore from application.core.settings import settings from application.vectorstore.document_class import Document -import elasticsearch - - class ElasticsearchStore(BaseVectorStore): @@ -26,8 +23,7 @@ class ElasticsearchStore(BaseVectorStore): else: raise ValueError("Please provide either elasticsearch_url or cloud_id.") - - + import elasticsearch ElasticsearchStore._es_connection = elasticsearch.Elasticsearch(**connection_params) self.docsearch = ElasticsearchStore._es_connection @@ -155,8 +151,6 @@ class ElasticsearchStore(BaseVectorStore): **kwargs, ): - from elasticsearch.helpers import BulkIndexError, bulk - bulk_kwargs = bulk_kwargs or {} import uuid embeddings = [] @@ -189,6 +183,7 @@ class ElasticsearchStore(BaseVectorStore): if len(requests) > 0: + from elasticsearch.helpers import BulkIndexError, bulk try: success, failed = bulk( self._es_connection,