Support more azure openai api_type (#1059)

This commit is contained in:
Li Jiang
2023-05-31 20:07:57 +08:00
committed by GitHub
parent fed28e700b
commit b975df81da

View File

@@ -236,7 +236,7 @@ class Completion(openai_Completion):
request_timeout = min(request_timeout, time_left)
sleep(cls.retry_time)
except InvalidRequestError:
if "azure" == config.get("api_type", openai.api_type) and "model" in config:
if "azure" in config.get("api_type", openai.api_type) and "model" in config:
# azure api uses "engine" instead of "model"
config["engine"] = config.pop("model").replace("gpt-3.5-turbo", "gpt-35-turbo")
else: