mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 12:05:54 +00:00
阿里云百炼适配
新增阿里云请求器配置、阿里云模型配置、阿里云令牌配置 新增硅基模型配置
This commit is contained in:
@@ -6,7 +6,7 @@ from . import entities, requester
|
||||
from ...core import app
|
||||
|
||||
from . import token
|
||||
from .requesters import chatcmpl, anthropicmsgs, moonshotchatcmpl, deepseekchatcmpl, ollamachat, giteeaichatcmpl, xaichatcmpl, zhipuaichatcmpl, lmstudiochatcmpl, siliconflowchatcmpl
|
||||
from .requesters import chatcmpl, anthropicmsgs, moonshotchatcmpl, deepseekchatcmpl, ollamachat, giteeaichatcmpl, xaichatcmpl, zhipuaichatcmpl, lmstudiochatcmpl, siliconflowchatcmpl, aliyunchatcmpl
|
||||
|
||||
FETCH_MODEL_LIST_URL = "https://api.qchatgpt.rockchin.top/api/v2/fetch/model_list"
|
||||
|
||||
|
||||
21
pkg/provider/modelmgr/requesters/aliyunchatcmpl.py
Normal file
21
pkg/provider/modelmgr/requesters/aliyunchatcmpl.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import openai
|
||||
|
||||
from . import chatcmpl
|
||||
from .. import requester
|
||||
from ....core import app
|
||||
|
||||
|
||||
@requester.requester_class("aliyun-chat-completions")
|
||||
class AliyunChatCompletions(chatcmpl.OpenAIChatCompletions):
|
||||
"""Aliyun ChatCompletion API 请求器"""
|
||||
|
||||
client: openai.AsyncClient
|
||||
|
||||
requester_cfg: dict
|
||||
|
||||
def __init__(self, ap: app.Application):
|
||||
self.ap = ap
|
||||
|
||||
self.requester_cfg = self.ap.provider_cfg.data['requester']['aliyun-chat-completions']
|
||||
@@ -211,6 +211,30 @@
|
||||
"requester": "zhipuai-chat-completions",
|
||||
"token_mgr": "zhipuai",
|
||||
"vision_supported": true
|
||||
},
|
||||
{
|
||||
"name": "siliconflow-r1",
|
||||
"model_name": "deepseek-ai/DeepSeek-R1",
|
||||
"requester": "siliconflow-chat-completions",
|
||||
"token_mgr": "siliconflow"
|
||||
},
|
||||
{
|
||||
"name": "siliconflow-v3",
|
||||
"model_name": "deepseek-ai/DeepSeek-V3",
|
||||
"requester": "siliconflow-chat-completions",
|
||||
"token_mgr": "siliconflow"
|
||||
},
|
||||
{
|
||||
"name": "aliyun-r1",
|
||||
"model_name": "deepseek-r1",
|
||||
"requester": "aliyun-chat-completions",
|
||||
"token_mgr": "aliyun"
|
||||
},
|
||||
{
|
||||
"name": "aliyun-v3",
|
||||
"model_name": "deepseek-v3",
|
||||
"requester": "aliyun-chat-completions",
|
||||
"token_mgr": "aliyun"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -84,7 +84,7 @@
|
||||
"model": "gpt-4o",
|
||||
"prompt-mode": "normal",
|
||||
"prompt": {
|
||||
"default": ""
|
||||
"default": ""
|
||||
},
|
||||
"runner": "local-agent",
|
||||
"dify-service-api": {
|
||||
|
||||
Reference in New Issue
Block a user