From 0e5d3968063f948ea1f7f8e02ef1ebfbef98fb23 Mon Sep 17 00:00:00 2001 From: Artem Astapenko Date: Thu, 12 Sep 2024 14:45:45 +0300 Subject: [PATCH] Add qdrant API key --- infra/production/files/docker-compose.yaml | 5 +++-- services/ml/app/config/config.py | 1 + services/ml/app/server.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/infra/production/files/docker-compose.yaml b/infra/production/files/docker-compose.yaml index 473fd76..b1bdab1 100644 --- a/infra/production/files/docker-compose.yaml +++ b/infra/production/files/docker-compose.yaml @@ -106,8 +106,9 @@ services: container_name: ml image: cr.yandex/crpc50gkvq2bp251sfgb/ml environment: - FAISS_INDEX_PATH: /data/faiss_index - USE_OPENROUTER: false + LLM_SOURCE: openai + QDRANT_HOST: http://qdrant:6333 + OPENAI_API_KEY: ${OPENAI_API_KEY} volumes: - /home/yc-user/model_cache:/app/model_cache - /home/yc-user/index_faiss:/data/faiss_index diff --git a/services/ml/app/config/config.py b/services/ml/app/config/config.py index 5d3b40f..94c91d5 100644 --- a/services/ml/app/config/config.py +++ b/services/ml/app/config/config.py @@ -4,6 +4,7 @@ class Config: PORT: int = int(os.environ.get("PORT", 8000)) QDRANT_HOST: str = os.environ.get("QDRANT_HOST", "http://localhost:6333") QDRANT_COLLECTION_NAME: str = os.environ.get("QDRANT_COLLECTION_NAME", "test") + QDRANT_API_KEY: str = os.environ.get("QDRANT_API_KEY") LLM_SOURCE: str = os.environ.get("LLM_SOURCE", "openai") def __init__(self): diff --git a/services/ml/app/server.py b/services/ml/app/server.py index d5a8204..83c6a13 100644 --- a/services/ml/app/server.py +++ b/services/ml/app/server.py @@ -10,7 +10,7 @@ from .config import config llm_instance = LLMInstance(config) -retriever_instance = Retriever(llm_instance.get_embeddings(), host=config.QDRANT_HOST, collection_name=config.QDRANT_COLLECTION_NAME) +retriever_instance = Retriever(llm_instance.get_embeddings(), host=config.QDRANT_HOST, collection_name=config.QDRANT_COLLECTION_NAME, api_key=config.QDRANT_API_KEY) class InputChat(BaseModel):