From 84168e22d0d995740d34992ea1cb0d7342322a80 Mon Sep 17 00:00:00 2001 From: Anton Larin Date: Sat, 17 Jun 2023 16:09:22 +0200 Subject: [PATCH] add missing variable after testin and minor fixes. --- docker-compose-azure.yaml | 2 ++ run-with-docker-compose.sh | 2 ++ scripts/parser/open_ai_func.py | 1 + 3 files changed, 5 insertions(+) diff --git a/docker-compose-azure.yaml b/docker-compose-azure.yaml index 81c67c21..773196dc 100644 --- a/docker-compose-azure.yaml +++ b/docker-compose-azure.yaml @@ -19,6 +19,7 @@ services: - CELERY_BROKER_URL=redis://redis:6379/0 - CELERY_RESULT_BACKEND=redis://redis:6379/1 - MONGO_URI=mongodb://mongo:27017/docsgpt + - OPENAI_API_KEY=$OPENAI_API_KEY - OPENAI_API_BASE=$OPENAI_API_BASE - OPENAI_API_VERSION=$OPENAI_API_VERSION - AZURE_DEPLOYMENT_NAME=$AZURE_DEPLOYMENT_NAME @@ -43,6 +44,7 @@ services: - CELERY_RESULT_BACKEND=redis://redis:6379/1 - MONGO_URI=mongodb://mongo:27017/docsgpt - API_URL=http://backend:5001 + - OPENAI_API_KEY=$OPENAI_API_KEY - OPENAI_API_BASE=$OPENAI_API_BASE - OPENAI_API_VERSION=$OPENAI_API_VERSION - AZURE_DEPLOYMENT_NAME=$AZURE_DEPLOYMENT_NAME diff --git a/run-with-docker-compose.sh b/run-with-docker-compose.sh index f59cf93b..4c892298 100755 --- a/run-with-docker-compose.sh +++ b/run-with-docker-compose.sh @@ -3,7 +3,9 @@ source .env if [[ -n "$OPENAI_API_BASE" ]] && [[ -n "$OPENAI_API_VERSION" ]] && [[ -n "$AZURE_DEPLOYMENT_NAME" ]] && [[ -n "$AZURE_EMBEDDINGS_DEPLOYMENT_NAME" ]]; then + echo "Running Azure Configuration" docker-compose -f docker-compose-azure.yaml build && docker-compose -f docker-compose-azure.yaml up else + echo "Running Plain Configuration" docker-compose build && docker-compose up fi diff --git a/scripts/parser/open_ai_func.py b/scripts/parser/open_ai_func.py index d8174023..63b06634 100644 --- a/scripts/parser/open_ai_func.py +++ b/scripts/parser/open_ai_func.py @@ -49,6 +49,7 @@ def call_openai_api(docs, folder_name): os.environ.get("OPENAI_API_BASE") and os.environ.get("OPENAI_API_VERSION") and os.environ.get("AZURE_DEPLOYMENT_NAME") + and os.environ.get("AZURE_EMBEDDINGS_DEPLOYMENT_NAME") ): os.environ["OPENAI_API_TYPE"] = "azure" openai_embeddings = OpenAIEmbeddings(model=os.environ.get("AZURE_EMBEDDINGS_DEPLOYMENT_NAME"))