Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 24, 2024
1 parent 3d64a6a commit 3814286
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
11 changes: 3 additions & 8 deletions comps/dataprep/pgvector/langchain/prepare_doc_pgvector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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"])
Expand Down
6 changes: 3 additions & 3 deletions tests/test_dataprep_pgvector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 3814286

Please sign in to comment.