From b0a401a1ed437ae0a7bfb0bab7c2182b47724bc3 Mon Sep 17 00:00:00 2001 From: lanvent Date: Fri, 28 Apr 2023 10:51:22 +0800 Subject: [PATCH] fix(azure_dalle): use openai.api_base --- bot/chatgpt/chat_gpt_bot.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bot/chatgpt/chat_gpt_bot.py b/bot/chatgpt/chat_gpt_bot.py index f7c1d65..c35d711 100644 --- a/bot/chatgpt/chat_gpt_bot.py +++ b/bot/chatgpt/chat_gpt_bot.py @@ -158,9 +158,8 @@ class AzureChatGPTBot(ChatGPTBot): self.args["deployment_id"] = conf().get("azure_deployment_id") def create_img(self, query, retry_count=0, api_key=None): - api_base = "https://a-wxf.openai.azure.com/" api_version = "2022-08-03-preview" - url = "{}dalle/text-to-image?api-version={}".format(api_base, api_version) + url = "{}dalle/text-to-image?api-version={}".format(openai.api_base, api_version) api_key = api_key or openai.api_key headers = {"api-key": api_key, "Content-Type": "application/json"} try: