diff --git a/.env.example b/.env.example index 9b6d8325..25637d4c 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,7 @@ AZURE_OPENAI_DEPLOYMENT_NAME=placeholder AZURE_OPENAI_API_KEY=placeholder AZURE_OPENAI_API_BASE=placeholder AZURE_OPENAI_API_VERSION=placeholder +AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME=placeholder CONNERY_RUNNER_URL=https://your-personal-connery-runner-url CONNERY_RUNNER_API_KEY=placeholder PROXY_URL=your_proxy_url diff --git a/backend/app/upload.py b/backend/app/upload.py index 075274d2..81e0fb3d 100644 --- a/backend/app/upload.py +++ b/backend/app/upload.py @@ -63,7 +63,11 @@ def _determine_azure_or_openai_embeddings() -> PGVector: if os.environ.get("AZURE_OPENAI_API_KEY"): return PGVector( connection_string=PG_CONNECTION_STRING, - embedding_function=AzureOpenAIEmbeddings(), + embedding_function=AzureOpenAIEmbeddings( + azure_endpoint=os.environ.get("AZURE_OPENAI_API_BASE"), + azure_deployment=os.environ.get("AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME"), + openai_api_version=os.environ.get("AZURE_OPENAI_API_VERSION") + ), use_jsonb=True, ) raise ValueError(