From fe62af7035779a8735b10827b7bba38e96619b0a Mon Sep 17 00:00:00 2001 From: Markus <29640970+mfeyx@users.noreply.github.com> Date: Mon, 23 Oct 2023 10:36:37 +0200 Subject: [PATCH] Update ai.py Added OPENAI_API_VERSION from env --- gpt_engineer/core/ai.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gpt_engineer/core/ai.py b/gpt_engineer/core/ai.py index 15b0d5c409..d9fb77575c 100644 --- a/gpt_engineer/core/ai.py +++ b/gpt_engineer/core/ai.py @@ -28,6 +28,7 @@ import json import logging +import os from dataclasses import dataclass from typing import List, Optional, Union @@ -506,7 +507,7 @@ def _create_chat_model(self) -> BaseChatModel: if self.azure_endpoint: return AzureChatOpenAI( openai_api_base=self.azure_endpoint, - openai_api_version="2023-05-15", # might need to be flexible in the future + openai_api_version=os.getenv("OPENAI_API_VERSION", "2023-05-15"), deployment_name=self.model_name, openai_api_type="azure", streaming=True,