mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-17 11:07:11 +08:00
Merge branch 'master' of github.com:zhayujie/chatgpt-on-wechat
This commit is contained in:
@@ -430,6 +430,13 @@ class AzureChatGPTBot(ChatGPTBot):
|
|||||||
else:
|
else:
|
||||||
return False, _t("图片生成失败,未配置text_to_image参数", "Image generation failed: text_to_image is not configured")
|
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):
|
class _AzureChatHTTPClient(OpenAIHTTPClient):
|
||||||
"""Subclass that injects Azure's ``api-version`` query param and ``api-key``
|
"""Subclass that injects Azure's ``api-version`` query param and ``api-key``
|
||||||
@@ -462,3 +469,4 @@ class _AzureChatHTTPClient(OpenAIHTTPClient):
|
|||||||
eq.setdefault("api-version", self._api_version)
|
eq.setdefault("api-version", self._api_version)
|
||||||
kwargs["extra_query"] = eq
|
kwargs["extra_query"] = eq
|
||||||
return super().chat_completions(**kwargs)
|
return super().chat_completions(**kwargs)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user