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 Jan 14, 2025
1 parent 274a12d commit d7f52ca
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions comps/retrievers/src/integrations/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def format_redis_conn_from_env():
OPENSEARCH_PORT = int(os.getenv("OPENSEARCH_PORT", 9200))
OPENSEARCH_INITIAL_ADMIN_PASSWORD = os.getenv("OPENSEARCH_INITIAL_ADMIN_PASSWORD", "")


def format_opensearch_conn_from_env():
opensearch_url = os.getenv("OPENSEARCH_URL", None)
if opensearch_url:
Expand All @@ -134,6 +135,8 @@ def format_opensearch_conn_from_env():
start = "https://" if using_ssl else "http://"

return start + f"{OPENSEARCH_HOST}:{OPENSEARCH_PORT}"


OPENSEARCH_URL = format_opensearch_conn_from_env()
OPENSEARCH_INDEX_NAME = os.getenv("OPENSEARCH_INDEX_NAME", "rag_opensearch")

Expand Down
4 changes: 4 additions & 0 deletions comps/retrievers/src/integrations/pathway.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@


import os

from langchain_community.vectorstores import PathwayVectorClient

from comps import CustomLogger, EmbedDoc, OpeaComponent, OpeaComponentRegistry, SearchedDoc, ServiceType

from .config import PATHWAY_HOST, PATHWAY_PORT

logger = CustomLogger("pathway_retrievers")
logflag = os.getenv("LOGFLAG", False)


@OpeaComponentRegistry.register("OPEA_RETRIEVER_PATHWAY")
class OpeaPathwayRetriever(OpeaComponent):
"""A specialized retriever component derived from OpeaComponent for pathway retriever services.
Expand Down
2 changes: 1 addition & 1 deletion comps/retrievers/src/opea_retrievers_microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

# import for retrievers component registration
from integrations.elasticsearch import OpeaElasticsearchRetriever
from integrations.neo4j import OpeaNeo4jRetriever
from integrations.milvus import OpeaMilvusRetriever
from integrations.neo4j import OpeaNeo4jRetriever
from integrations.opensearch import OpeaOpensearchRetriever
from integrations.pathway import OpeaPathwayRetriever
from integrations.pgvector import OpeaPGVectorRetriever
Expand Down
8 changes: 4 additions & 4 deletions comps/vectorstores/pathway/vectorstore_pathway.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import logging
import os
import nltk

import nltk
import pathway as pw
from langchain import text_splitter
from langchain_community.embeddings import HuggingFaceBgeEmbeddings
Expand All @@ -18,9 +18,9 @@
datefmt="%Y-%m-%d %H:%M:%S",
)

nltk.download('punkt')
nltk.download('punkt_tab')
nltk.download('averaged_perceptron_tagger_eng')
nltk.download("punkt")
nltk.download("punkt_tab")
nltk.download("averaged_perceptron_tagger_eng")

# This creates a Pathway connector that tracks all the files in the `data/` directory.
# Additions and modifications will be reflected on the index automatically.
Expand Down
2 changes: 1 addition & 1 deletion tests/retrievers/test_retrievers_pathway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ function main() {

}

main
main

0 comments on commit d7f52ca

Please sign in to comment.