diff --git a/comps/retrievers/opensearch/langchain/requirements.txt b/comps/retrievers/opensearch/langchain/requirements.txt index 7fb987ccb..5690118bb 100644 --- a/comps/retrievers/opensearch/langchain/requirements.txt +++ b/comps/retrievers/opensearch/langchain/requirements.txt @@ -3,14 +3,14 @@ easyocr fastapi langchain_community langchain_huggingface +numpy opensearch-py opentelemetry-api opentelemetry-exporter-otlp opentelemetry-sdk prometheus-fastapi-instrumentator +pydantic pymupdf sentence_transformers shortuuid uvicorn -pydantic -numpy diff --git a/comps/retrievers/opensearch/langchain/retriever_opensearch.py b/comps/retrievers/opensearch/langchain/retriever_opensearch.py index f5b260230..c570cb6db 100644 --- a/comps/retrievers/opensearch/langchain/retriever_opensearch.py +++ b/comps/retrievers/opensearch/langchain/retriever_opensearch.py @@ -3,9 +3,9 @@ import os import time -import numpy as np -from typing import Union, List, Callable +from typing import Callable, List, Union +import numpy as np from langchain_community.embeddings import HuggingFaceBgeEmbeddings from langchain_community.vectorstores import OpenSearchVectorSearch from langchain_huggingface import HuggingFaceEndpointEmbeddings @@ -37,11 +37,8 @@ async def search_all_embeddings_vectors( - embeddings: Union[conlist(float, min_length=0), List[conlist(float, min_length=0)]], - func: Callable, - *args, - **kwargs - ): + embeddings: Union[conlist(float, min_length=0), List[conlist(float, min_length=0)]], func: Callable, *args, **kwargs +): try: if not isinstance(embeddings, np.ndarray): embeddings = np.array(embeddings)