Merge pull request #648 from pratiksinghchauhan/fix-#323-error-communicating-to-openai

Fix #323 Error communicating with OpenAI: Invalid URL 'your-base-url-for-azure/embeddings'
This commit is contained in:
Toran Bruce Richards
2023-04-10 22:46:46 +01:00
committed by GitHub
3 changed files with 8 additions and 8 deletions

View File

@@ -46,9 +46,9 @@ class Config(metaclass=Singleton):
self.use_azure = False
self.use_azure = os.getenv("USE_AZURE") == 'True'
if self.use_azure:
self.openai_api_base = os.getenv("OPENAI_API_BASE")
self.openai_api_version = os.getenv("OPENAI_API_VERSION")
self.openai_deployment_id = os.getenv("OPENAI_DEPLOYMENT_ID")
self.openai_api_base = os.getenv("OPENAI_AZURE_API_BASE")
self.openai_api_version = os.getenv("OPENAI_AZURE_API_VERSION")
self.openai_deployment_id = os.getenv("OPENAI_AZURE_DEPLOYMENT_ID")
openai.api_type = "azure"
openai.api_base = self.openai_api_base
openai.api_version = self.openai_api_version