From 3814286ae49e7012f5879991c10e962d3da7d038 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 18:00:19 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../pgvector/langchain/prepare_doc_pgvector.py | 11 +++-------- tests/test_dataprep_pgvector.sh | 6 +++--- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/comps/dataprep/pgvector/langchain/prepare_doc_pgvector.py b/comps/dataprep/pgvector/langchain/prepare_doc_pgvector.py index 779efa708..02f034b3f 100644 --- a/comps/dataprep/pgvector/langchain/prepare_doc_pgvector.py +++ b/comps/dataprep/pgvector/langchain/prepare_doc_pgvector.py @@ -14,13 +14,7 @@ from langchain_community.vectorstores import PGVector from langsmith import traceable -from comps import ( - DocPath, - ServiceType, - opea_microservices, - register_microservice, - register_statistics -) +from comps import DocPath, ServiceType, opea_microservices, register_microservice, register_statistics from comps.dataprep.utils import document_loader, parse_html tei_embedding_endpoint = os.getenv("TEI_ENDPOINT") @@ -97,12 +91,13 @@ def ingest_link_to_pgvector(link_list: List[str]): connection_string=PG_CONNECTION_STRING, ) + @register_microservice( name="opea_service@prepare_doc_pgvector", service_type=ServiceType.DATAPREP, endpoint="/v1/dataprep", host="0.0.0.0", - port=6007 + port=6007, ) @traceable(run_type="tool") @register_statistics(names=["opea_service@dataprep_pgvector"]) diff --git a/tests/test_dataprep_pgvector.sh b/tests/test_dataprep_pgvector.sh index 473a787c8..c9daba9fc 100755 --- a/tests/test_dataprep_pgvector.sh +++ b/tests/test_dataprep_pgvector.sh @@ -26,15 +26,15 @@ function start_service() { sleep 10s docker run -d --name="dataprep-pgvector" -p 6007:6007 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e PG_CONNECTION_STRING=postgresql+psycopg2://${POSTGRES_USER}:${POSTGRES_PASSWORD}@$ip_address:5432/${POSTGRES_DB} opea/dataprep-pgvector:latest - + sleep 3m } function validate_microservice() { URL="http://$ip_address:6007/v1/dataprep" - echo 'The OPEA platform includes: Detailed framework of composable building blocks for state-of-the-art generative AI systems including LLMs, data stores, and prompt engines' > ./dataprep_file.txt + echo 'The OPEA platform includes: Detailed framework of composable building blocks for state-of-the-art generative AI systems including LLMs, data stores, and prompt engines' > ./dataprep_file.txt curl --noproxy $ip_address --location --request POST \ - --form 'files=@./dataprep_file.txt' $URL + --form 'files=@./dataprep_file.txt' $URL } function stop_docker() {