From 936eaf59399cd34c5acc461c721527743bd077a2 Mon Sep 17 00:00:00 2001 From: Eric L <2023340273@qq.com> Date: Thu, 25 Jun 2026 21:13:50 +0800 Subject: [PATCH 1/2] fix: azure openai stream --- models/chatgpt/chat_gpt_bot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/models/chatgpt/chat_gpt_bot.py b/models/chatgpt/chat_gpt_bot.py index 1bc2a9da..e55dbaaa 100644 --- a/models/chatgpt/chat_gpt_bot.py +++ b/models/chatgpt/chat_gpt_bot.py @@ -462,3 +462,10 @@ class _AzureChatHTTPClient(OpenAIHTTPClient): eq.setdefault("api-version", self._api_version) kwargs["extra_query"] = eq return super().chat_completions(**kwargs) + + def get_api_config(self): + config = super().get_api_config() + # The Azure HTTP client already stores the deployment-scoped base URL. + # Passing the raw endpoint again would override it in call_with_tools(). + config["api_base"] = None + return config From f49e965736bd5ab602ea4e40322a90d3c17589a4 Mon Sep 17 00:00:00 2001 From: Eric L <2023340273@qq.com> Date: Fri, 26 Jun 2026 20:54:25 +0800 Subject: [PATCH 2/2] fix: azure openai stream config --- models/chatgpt/chat_gpt_bot.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/models/chatgpt/chat_gpt_bot.py b/models/chatgpt/chat_gpt_bot.py index e55dbaaa..ac00693d 100644 --- a/models/chatgpt/chat_gpt_bot.py +++ b/models/chatgpt/chat_gpt_bot.py @@ -430,6 +430,13 @@ class AzureChatGPTBot(ChatGPTBot): else: return False, _t("图片生成失败,未配置text_to_image参数", "Image generation failed: text_to_image is not configured") + def get_api_config(self): + config = super().get_api_config() + # The Azure HTTP client already stores the deployment-scoped base URL. + # Passing the raw endpoint again would override it in call_with_tools(). + config["api_base"] = None + return config + class _AzureChatHTTPClient(OpenAIHTTPClient): """Subclass that injects Azure's ``api-version`` query param and ``api-key`` @@ -463,9 +470,3 @@ class _AzureChatHTTPClient(OpenAIHTTPClient): kwargs["extra_query"] = eq return super().chat_completions(**kwargs) - def get_api_config(self): - config = super().get_api_config() - # The Azure HTTP client already stores the deployment-scoped base URL. - # Passing the raw endpoint again would override it in call_with_tools(). - config["api_base"] = None - return config