Fixed incorrect usage for Azure OpenAI API

This commit is contained in:
zmeir
2023-08-28 16:13:26 +03:00
parent 33ef23289f
commit 314d13e25f

View File

@ -87,8 +87,6 @@ class AiHandler:
f"Generating completion with {model}"
f"{(' from deployment ' + deployment_id) if deployment_id else ''}"
)
if self.azure:
model = self.azure + "/" + model
response = await acompletion(
model=model,
deployment_id=deployment_id,
@ -97,6 +95,7 @@ class AiHandler:
{"role": "user", "content": user}
],
temperature=temperature,
azure=self.azure,
force_timeout=get_settings().config.ai_timeout
)
except (APIError, Timeout, TryAgain) as e: