From 0aa072b4e8935a7d5eb764f4a5c61f3d192040f6 Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Fri, 28 Feb 2025 22:47:34 +0800 Subject: [PATCH 1/2] feat: add manifests for all requesters --- .../modelmgr/requesters/anthropicmsgs.yaml | 34 +++++++++++++++++++ .../modelmgr/requesters/bailianchatcmpl.yaml | 34 +++++++++++++++++++ .../modelmgr/requesters/chatcmpl.yaml | 34 +++++++++++++++++++ .../modelmgr/requesters/deepseekchatcmpl.yaml | 34 +++++++++++++++++++ .../modelmgr/requesters/giteeaichatcmpl.yaml | 34 +++++++++++++++++++ .../modelmgr/requesters/lmstudiochatcmpl.yaml | 34 +++++++++++++++++++ .../modelmgr/requesters/moonshotchatcmpl.yaml | 34 +++++++++++++++++++ .../modelmgr/requesters/ollamachat.yaml | 34 +++++++++++++++++++ .../requesters/siliconflowchatcmpl.yaml | 34 +++++++++++++++++++ .../modelmgr/requesters/volcarkchatcmpl.yaml | 34 +++++++++++++++++++ .../modelmgr/requesters/xaichatcmpl.yaml | 34 +++++++++++++++++++ .../modelmgr/requesters/zhipuaichatcmpl.yaml | 34 +++++++++++++++++++ 12 files changed, 408 insertions(+) create mode 100644 pkg/provider/modelmgr/requesters/anthropicmsgs.yaml create mode 100644 pkg/provider/modelmgr/requesters/bailianchatcmpl.yaml create mode 100644 pkg/provider/modelmgr/requesters/chatcmpl.yaml create mode 100644 pkg/provider/modelmgr/requesters/deepseekchatcmpl.yaml create mode 100644 pkg/provider/modelmgr/requesters/giteeaichatcmpl.yaml create mode 100644 pkg/provider/modelmgr/requesters/lmstudiochatcmpl.yaml create mode 100644 pkg/provider/modelmgr/requesters/moonshotchatcmpl.yaml create mode 100644 pkg/provider/modelmgr/requesters/ollamachat.yaml create mode 100644 pkg/provider/modelmgr/requesters/siliconflowchatcmpl.yaml create mode 100644 pkg/provider/modelmgr/requesters/volcarkchatcmpl.yaml create mode 100644 pkg/provider/modelmgr/requesters/xaichatcmpl.yaml create mode 100644 pkg/provider/modelmgr/requesters/zhipuaichatcmpl.yaml diff --git a/pkg/provider/modelmgr/requesters/anthropicmsgs.yaml b/pkg/provider/modelmgr/requesters/anthropicmsgs.yaml new file mode 100644 index 00000000..934db905 --- /dev/null +++ b/pkg/provider/modelmgr/requesters/anthropicmsgs.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: anthropic-messages + label: + en_US: Anthropic + zh_CN: Anthropic +spec: + config: + - name: base-url + label: + en_US: Base URL + zh_CN: 基础 URL + type: string + required: true + default: "https://api.anthropic.com/v1" + - name: args + label: + en_US: Args + zh_CN: 附加参数 + type: object + required: true + default: {} + - name: timeout + label: + en_US: Timeout + zh_CN: 超时时间 + type: int + required: true + default: 120 +execution: + python: + path: ./anthropicmsgs.py + attr: AnthropicMessages diff --git a/pkg/provider/modelmgr/requesters/bailianchatcmpl.yaml b/pkg/provider/modelmgr/requesters/bailianchatcmpl.yaml new file mode 100644 index 00000000..0107d1a6 --- /dev/null +++ b/pkg/provider/modelmgr/requesters/bailianchatcmpl.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: bailian-chat-completions + label: + en_US: Aliyun Bailian + zh_CN: 阿里云百炼 +spec: + config: + - name: base-url + label: + en_US: Base URL + zh_CN: 基础 URL + type: string + required: true + default: "https://dashscope.aliyuncs.com/compatible-mode/v1" + - name: args + label: + en_US: Args + zh_CN: 附加参数 + type: object + required: true + default: {} + - name: timeout + label: + en_US: Timeout + zh_CN: 超时时间 + type: int + required: true + default: 120 +execution: + python: + path: ./bailianchatcmpl.py + attr: BailianChatCompletions diff --git a/pkg/provider/modelmgr/requesters/chatcmpl.yaml b/pkg/provider/modelmgr/requesters/chatcmpl.yaml new file mode 100644 index 00000000..9e623542 --- /dev/null +++ b/pkg/provider/modelmgr/requesters/chatcmpl.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: openai-chat-completions + label: + en_US: OpenAI + zh_CN: OpenAI +spec: + config: + - name: base-url + label: + en_US: Base URL + zh_CN: 基础 URL + type: string + required: true + default: "https://api.openai.com/v1" + - name: args + label: + en_US: Args + zh_CN: 附加参数 + type: object + required: true + default: {} + - name: timeout + label: + en_US: Timeout + zh_CN: 超时时间 + type: int + required: true + default: 120 +execution: + python: + path: ./chatcmpl.py + attr: OpenAIChatCompletions \ No newline at end of file diff --git a/pkg/provider/modelmgr/requesters/deepseekchatcmpl.yaml b/pkg/provider/modelmgr/requesters/deepseekchatcmpl.yaml new file mode 100644 index 00000000..2eb56be4 --- /dev/null +++ b/pkg/provider/modelmgr/requesters/deepseekchatcmpl.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: deepseek-chat-completions + label: + en_US: DeepSeek + zh_CN: 深度求索 +spec: + config: + - name: base-url + label: + en_US: Base URL + zh_CN: 基础 URL + type: string + required: true + default: "https://api.deepseek.com" + - name: args + label: + en_US: Args + zh_CN: 附加参数 + type: object + required: true + default: {} + - name: timeout + label: + en_US: Timeout + zh_CN: 超时时间 + type: int + required: true + default: 120 +execution: + python: + path: ./deepseekchatcmpl.py + attr: DeepseekChatCompletions \ No newline at end of file diff --git a/pkg/provider/modelmgr/requesters/giteeaichatcmpl.yaml b/pkg/provider/modelmgr/requesters/giteeaichatcmpl.yaml new file mode 100644 index 00000000..67178cd1 --- /dev/null +++ b/pkg/provider/modelmgr/requesters/giteeaichatcmpl.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: gitee-ai-chat-completions + label: + en_US: Gitee AI + zh_CN: Gitee AI +spec: + config: + - name: base-url + label: + en_US: Base URL + zh_CN: 基础 URL + type: string + required: true + default: "https://ai.gitee.com/v1" + - name: args + label: + en_US: Args + zh_CN: 附加参数 + type: object + required: true + default: {} + - name: timeout + label: + en_US: Timeout + zh_CN: 超时时间 + type: int + required: true + default: 120 +execution: + python: + path: ./giteeaichatcmpl.py + attr: GiteeAIChatCompletions \ No newline at end of file diff --git a/pkg/provider/modelmgr/requesters/lmstudiochatcmpl.yaml b/pkg/provider/modelmgr/requesters/lmstudiochatcmpl.yaml new file mode 100644 index 00000000..2b18e92c --- /dev/null +++ b/pkg/provider/modelmgr/requesters/lmstudiochatcmpl.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: lmstudio-chat-completions + label: + en_US: LM Studio + zh_CN: LM Studio +spec: + config: + - name: base-url + label: + en_US: Base URL + zh_CN: 基础 URL + type: string + required: true + default: "http://127.0.0.1:1234/v1" + - name: args + label: + en_US: Args + zh_CN: 附加参数 + type: object + required: true + default: {} + - name: timeout + label: + en_US: Timeout + zh_CN: 超时时间 + type: int + required: true + default: 120 +execution: + python: + path: ./lmstudiochatcmpl.py + attr: LmStudioChatCompletions diff --git a/pkg/provider/modelmgr/requesters/moonshotchatcmpl.yaml b/pkg/provider/modelmgr/requesters/moonshotchatcmpl.yaml new file mode 100644 index 00000000..2680cea1 --- /dev/null +++ b/pkg/provider/modelmgr/requesters/moonshotchatcmpl.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: moonshot-chat-completions + label: + en_US: Moonshot + zh_CN: 月之暗面 +spec: + config: + - name: base-url + label: + en_US: Base URL + zh_CN: 基础 URL + type: string + required: true + default: "https://api.moonshot.com/v1" + - name: args + label: + en_US: Args + zh_CN: 附加参数 + type: object + required: true + default: {} + - name: timeout + label: + en_US: Timeout + zh_CN: 超时时间 + type: int + required: true + default: 120 +execution: + python: + path: ./moonshotchatcmpl.py + attr: MoonshotChatCompletions diff --git a/pkg/provider/modelmgr/requesters/ollamachat.yaml b/pkg/provider/modelmgr/requesters/ollamachat.yaml new file mode 100644 index 00000000..9c2e83f3 --- /dev/null +++ b/pkg/provider/modelmgr/requesters/ollamachat.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: ollama-chat + label: + en_US: Ollama + zh_CN: Ollama +spec: + config: + - name: base-url + label: + en_US: Base URL + zh_CN: 基础 URL + type: string + required: true + default: "http://127.0.0.1:11434" + - name: args + label: + en_US: Args + zh_CN: 附加参数 + type: object + required: true + default: {} + - name: timeout + label: + en_US: Timeout + zh_CN: 超时时间 + type: int + required: true + default: 120 +execution: + python: + path: ./ollamachat.py + attr: OllamaChatCompletions diff --git a/pkg/provider/modelmgr/requesters/siliconflowchatcmpl.yaml b/pkg/provider/modelmgr/requesters/siliconflowchatcmpl.yaml new file mode 100644 index 00000000..02b08fea --- /dev/null +++ b/pkg/provider/modelmgr/requesters/siliconflowchatcmpl.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: siliconflow-chat-completions + label: + en_US: SiliconFlow + zh_CN: 硅基流动 +spec: + config: + - name: base-url + label: + en_US: Base URL + zh_CN: 基础 URL + type: string + required: true + default: "https://api.siliconflow.cn/v1" + - name: args + label: + en_US: Args + zh_CN: 附加参数 + type: object + required: true + default: {} + - name: timeout + label: + en_US: Timeout + zh_CN: 超时时间 + type: int + required: true + default: 120 +execution: + python: + path: ./siliconflowchatcmpl.py + attr: SiliconFlowChatCompletions diff --git a/pkg/provider/modelmgr/requesters/volcarkchatcmpl.yaml b/pkg/provider/modelmgr/requesters/volcarkchatcmpl.yaml new file mode 100644 index 00000000..9beee799 --- /dev/null +++ b/pkg/provider/modelmgr/requesters/volcarkchatcmpl.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: volcark-chat-completions + label: + en_US: Volc Engine Ark + zh_CN: 火山方舟 +spec: + config: + - name: base-url + label: + en_US: Base URL + zh_CN: 基础 URL + type: string + required: true + default: "https://ark.cn-beijing.volces.com/api/v3" + - name: args + label: + en_US: Args + zh_CN: 附加参数 + type: object + required: true + default: {} + - name: timeout + label: + en_US: Timeout + zh_CN: 超时时间 + type: int + required: true + default: 120 +execution: + python: + path: ./volcarkchatcmpl.py + attr: VolcArkChatCompletions diff --git a/pkg/provider/modelmgr/requesters/xaichatcmpl.yaml b/pkg/provider/modelmgr/requesters/xaichatcmpl.yaml new file mode 100644 index 00000000..a9eee84d --- /dev/null +++ b/pkg/provider/modelmgr/requesters/xaichatcmpl.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: xai-chat-completions + label: + en_US: xAI + zh_CN: xAI +spec: + config: + - name: base-url + label: + en_US: Base URL + zh_CN: 基础 URL + type: string + required: true + default: "https://api.x.ai/v1" + - name: args + label: + en_US: Args + zh_CN: 附加参数 + type: object + required: true + default: {} + - name: timeout + label: + en_US: Timeout + zh_CN: 超时时间 + type: int + required: true + default: 120 +execution: + python: + path: ./xaichatcmpl.py + attr: XaiChatCompletions diff --git a/pkg/provider/modelmgr/requesters/zhipuaichatcmpl.yaml b/pkg/provider/modelmgr/requesters/zhipuaichatcmpl.yaml new file mode 100644 index 00000000..76ab63e9 --- /dev/null +++ b/pkg/provider/modelmgr/requesters/zhipuaichatcmpl.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: zhipuai-chat-completions + label: + en_US: ZhipuAI + zh_CN: 智谱 AI +spec: + config: + - name: base-url + label: + en_US: Base URL + zh_CN: 基础 URL + type: string + required: true + default: "https://open.bigmodel.cn/api/paas/v4" + - name: args + label: + en_US: Args + zh_CN: 附加参数 + type: object + required: true + default: {} + - name: timeout + label: + en_US: Timeout + zh_CN: 超时时间 + type: int + required: true + default: 120 +execution: + python: + path: ./zhipuaichatcmpl.py + attr: ZhipuAIChatCompletions From 81aacdd76ea8ea07b2e323a07dda6adac231819f Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Sat, 1 Mar 2025 00:12:23 +0800 Subject: [PATCH 2/2] refactor: lookup requester from discover engine --- pkg/discover/engine.py | 3 +++ pkg/provider/modelmgr/modelmgr.py | 15 ++++++++++++--- pkg/provider/modelmgr/requester.py | 12 ------------ pkg/provider/modelmgr/requesters/anthropicmsgs.py | 1 - .../modelmgr/requesters/bailianchatcmpl.py | 1 - pkg/provider/modelmgr/requesters/chatcmpl.py | 1 - .../modelmgr/requesters/deepseekchatcmpl.py | 1 - .../modelmgr/requesters/giteeaichatcmpl.py | 1 - .../modelmgr/requesters/lmstudiochatcmpl.py | 1 - .../modelmgr/requesters/moonshotchatcmpl.py | 1 - pkg/provider/modelmgr/requesters/ollamachat.py | 1 - .../modelmgr/requesters/siliconflowchatcmpl.py | 1 - .../modelmgr/requesters/volcarkchatcmpl.py | 1 - pkg/provider/modelmgr/requesters/xaichatcmpl.py | 1 - .../modelmgr/requesters/zhipuaichatcmpl.py | 1 - 15 files changed, 15 insertions(+), 27 deletions(-) diff --git a/pkg/discover/engine.py b/pkg/discover/engine.py index 2f6b29b7..297e6515 100644 --- a/pkg/discover/engine.py +++ b/pkg/discover/engine.py @@ -187,6 +187,9 @@ class ComponentDiscoveryEngine: if name == 'ComponentTemplate': continue components[name] = self.load_blueprint_comp_group(component, owner) + + self.ap.logger.debug(f'Components: {components}') + return blueprint_manifest, components diff --git a/pkg/provider/modelmgr/modelmgr.py b/pkg/provider/modelmgr/modelmgr.py index 7aa6b99f..e8c231c5 100644 --- a/pkg/provider/modelmgr/modelmgr.py +++ b/pkg/provider/modelmgr/modelmgr.py @@ -4,7 +4,7 @@ import aiohttp from . import entities, requester from ...core import app - +from ...discover import engine from . import token from .requesters import bailianchatcmpl, chatcmpl, anthropicmsgs, moonshotchatcmpl, deepseekchatcmpl, ollamachat, giteeaichatcmpl, volcarkchatcmpl, xaichatcmpl, zhipuaichatcmpl, lmstudiochatcmpl, siliconflowchatcmpl, volcarkchatcmpl @@ -16,6 +16,8 @@ class ModelManager: ap: app.Application + requester_components: list[engine.Component] + model_list: list[entities.LLMModelInfo] requesters: dict[str, requester.LLMAPIRequester] @@ -38,14 +40,21 @@ class ModelManager: async def initialize(self): + self.requester_components = self.ap.discover.get_components_by_kind('LLMAPIRequester') + # 初始化token_mgr, requester for k, v in self.ap.provider_cfg.data['keys'].items(): self.token_mgrs[k] = token.TokenManager(k, v) - for api_cls in requester.preregistered_requesters: + # for api_cls in requester.preregistered_requesters: + # api_inst = api_cls(self.ap) + # await api_inst.initialize() + # self.requesters[api_inst.name] = api_inst + for component in self.requester_components: + api_cls = component.get_python_component_class() api_inst = api_cls(self.ap) await api_inst.initialize() - self.requesters[api_inst.name] = api_inst + self.requesters[component.metadata.name] = api_inst # 尝试从api获取最新的模型信息 try: diff --git a/pkg/provider/modelmgr/requester.py b/pkg/provider/modelmgr/requester.py index cf29bd4d..147a97c4 100644 --- a/pkg/provider/modelmgr/requester.py +++ b/pkg/provider/modelmgr/requester.py @@ -10,18 +10,6 @@ from . import entities as modelmgr_entities from ..tools import entities as tools_entities -preregistered_requesters: list[typing.Type[LLMAPIRequester]] = [] - -def requester_class(name: str): - - def decorator(cls: typing.Type[LLMAPIRequester]) -> typing.Type[LLMAPIRequester]: - cls.name = name - preregistered_requesters.append(cls) - return cls - - return decorator - - class LLMAPIRequester(metaclass=abc.ABCMeta): """LLM API请求器 """ diff --git a/pkg/provider/modelmgr/requesters/anthropicmsgs.py b/pkg/provider/modelmgr/requesters/anthropicmsgs.py index 72301efd..c977a9f2 100644 --- a/pkg/provider/modelmgr/requesters/anthropicmsgs.py +++ b/pkg/provider/modelmgr/requesters/anthropicmsgs.py @@ -16,7 +16,6 @@ from ...tools import entities as tools_entities from ....utils import image -@requester.requester_class("anthropic-messages") class AnthropicMessages(requester.LLMAPIRequester): """Anthropic Messages API 请求器""" diff --git a/pkg/provider/modelmgr/requesters/bailianchatcmpl.py b/pkg/provider/modelmgr/requesters/bailianchatcmpl.py index cce003bd..8f6b258c 100644 --- a/pkg/provider/modelmgr/requesters/bailianchatcmpl.py +++ b/pkg/provider/modelmgr/requesters/bailianchatcmpl.py @@ -7,7 +7,6 @@ from .. import requester from ....core import app -@requester.requester_class("bailian-chat-completions") class BailianChatCompletions(chatcmpl.OpenAIChatCompletions): """阿里云百炼大模型平台 ChatCompletion API 请求器""" diff --git a/pkg/provider/modelmgr/requesters/chatcmpl.py b/pkg/provider/modelmgr/requesters/chatcmpl.py index cdd8e032..7bf83377 100644 --- a/pkg/provider/modelmgr/requesters/chatcmpl.py +++ b/pkg/provider/modelmgr/requesters/chatcmpl.py @@ -20,7 +20,6 @@ from ...tools import entities as tools_entities from ....utils import image -@requester.requester_class("openai-chat-completions") class OpenAIChatCompletions(requester.LLMAPIRequester): """OpenAI ChatCompletion API 请求器""" diff --git a/pkg/provider/modelmgr/requesters/deepseekchatcmpl.py b/pkg/provider/modelmgr/requesters/deepseekchatcmpl.py index 7b8c9ca8..f6453a19 100644 --- a/pkg/provider/modelmgr/requesters/deepseekchatcmpl.py +++ b/pkg/provider/modelmgr/requesters/deepseekchatcmpl.py @@ -7,7 +7,6 @@ from ... import entities as llm_entities from ...tools import entities as tools_entities -@requester.requester_class("deepseek-chat-completions") class DeepseekChatCompletions(chatcmpl.OpenAIChatCompletions): """Deepseek ChatCompletion API 请求器""" diff --git a/pkg/provider/modelmgr/requesters/giteeaichatcmpl.py b/pkg/provider/modelmgr/requesters/giteeaichatcmpl.py index d737f235..4beb6ba8 100644 --- a/pkg/provider/modelmgr/requesters/giteeaichatcmpl.py +++ b/pkg/provider/modelmgr/requesters/giteeaichatcmpl.py @@ -14,7 +14,6 @@ from ...tools import entities as tools_entities from .. import entities as modelmgr_entities -@requester.requester_class("gitee-ai-chat-completions") class GiteeAIChatCompletions(chatcmpl.OpenAIChatCompletions): """Gitee AI ChatCompletions API 请求器""" diff --git a/pkg/provider/modelmgr/requesters/lmstudiochatcmpl.py b/pkg/provider/modelmgr/requesters/lmstudiochatcmpl.py index 7ec89b2e..d2a9bcb7 100644 --- a/pkg/provider/modelmgr/requesters/lmstudiochatcmpl.py +++ b/pkg/provider/modelmgr/requesters/lmstudiochatcmpl.py @@ -7,7 +7,6 @@ from .. import requester from ....core import app -@requester.requester_class("lmstudio-chat-completions") class LmStudioChatCompletions(chatcmpl.OpenAIChatCompletions): """LMStudio ChatCompletion API 请求器""" diff --git a/pkg/provider/modelmgr/requesters/moonshotchatcmpl.py b/pkg/provider/modelmgr/requesters/moonshotchatcmpl.py index 95c4aaf5..2e94fd04 100644 --- a/pkg/provider/modelmgr/requesters/moonshotchatcmpl.py +++ b/pkg/provider/modelmgr/requesters/moonshotchatcmpl.py @@ -9,7 +9,6 @@ from ... import entities as llm_entities from ...tools import entities as tools_entities -@requester.requester_class("moonshot-chat-completions") class MoonshotChatCompletions(chatcmpl.OpenAIChatCompletions): """Moonshot ChatCompletion API 请求器""" diff --git a/pkg/provider/modelmgr/requesters/ollamachat.py b/pkg/provider/modelmgr/requesters/ollamachat.py index ba2ee66a..0ac2915f 100644 --- a/pkg/provider/modelmgr/requesters/ollamachat.py +++ b/pkg/provider/modelmgr/requesters/ollamachat.py @@ -20,7 +20,6 @@ from ....utils import image REQUESTER_NAME: str = "ollama-chat" -@requester.requester_class(REQUESTER_NAME) class OllamaChatCompletions(requester.LLMAPIRequester): """Ollama平台 ChatCompletion API请求器""" client: ollama.AsyncClient diff --git a/pkg/provider/modelmgr/requesters/siliconflowchatcmpl.py b/pkg/provider/modelmgr/requesters/siliconflowchatcmpl.py index 7c8eab7b..c763556f 100644 --- a/pkg/provider/modelmgr/requesters/siliconflowchatcmpl.py +++ b/pkg/provider/modelmgr/requesters/siliconflowchatcmpl.py @@ -7,7 +7,6 @@ from .. import requester from ....core import app -@requester.requester_class("siliconflow-chat-completions") class SiliconFlowChatCompletions(chatcmpl.OpenAIChatCompletions): """SiliconFlow ChatCompletion API 请求器""" diff --git a/pkg/provider/modelmgr/requesters/volcarkchatcmpl.py b/pkg/provider/modelmgr/requesters/volcarkchatcmpl.py index d0c13eaf..f2a58789 100644 --- a/pkg/provider/modelmgr/requesters/volcarkchatcmpl.py +++ b/pkg/provider/modelmgr/requesters/volcarkchatcmpl.py @@ -7,7 +7,6 @@ from .. import requester from ....core import app -@requester.requester_class("volcark-chat-completions") class VolcArkChatCompletions(chatcmpl.OpenAIChatCompletions): """火山方舟大模型平台 ChatCompletion API 请求器""" diff --git a/pkg/provider/modelmgr/requesters/xaichatcmpl.py b/pkg/provider/modelmgr/requesters/xaichatcmpl.py index 62f48bc9..217b142f 100644 --- a/pkg/provider/modelmgr/requesters/xaichatcmpl.py +++ b/pkg/provider/modelmgr/requesters/xaichatcmpl.py @@ -7,7 +7,6 @@ from .. import requester from ....core import app -@requester.requester_class("xai-chat-completions") class XaiChatCompletions(chatcmpl.OpenAIChatCompletions): """xAI ChatCompletion API 请求器""" diff --git a/pkg/provider/modelmgr/requesters/zhipuaichatcmpl.py b/pkg/provider/modelmgr/requesters/zhipuaichatcmpl.py index b0011001..18edd36d 100644 --- a/pkg/provider/modelmgr/requesters/zhipuaichatcmpl.py +++ b/pkg/provider/modelmgr/requesters/zhipuaichatcmpl.py @@ -7,7 +7,6 @@ from . import chatcmpl from .. import requester -@requester.requester_class("zhipuai-chat-completions") class ZhipuAIChatCompletions(chatcmpl.OpenAIChatCompletions): """智谱AI ChatCompletion API 请求器"""