add api_version to azure_openai_complete_if_cache

This commit is contained in:
Ahmad Hatahet
2024-11-30 17:47:33 +01:00
parent 9b92d425f6
commit 137315ec18

View File

@@ -92,12 +92,15 @@ async def azure_openai_complete_if_cache(
history_messages=[],
base_url=None,
api_key=None,
api_version=None,
**kwargs,
):
if api_key:
os.environ["AZURE_OPENAI_API_KEY"] = api_key
if base_url:
os.environ["AZURE_OPENAI_ENDPOINT"] = base_url
if api_version:
os.environ["AZURE_OPENAI_API_VERSION"] = api_version
openai_async_client = AsyncAzureOpenAI(
azure_endpoint=os.getenv("AZURE_OPENAI_ENDPOINT"),