Files
LangBot/pkg/provider/modelmgr/requesters/aliyunchatcmpl.py
wanjiaju 9eefbcb6f2 阿里云百炼适配
新增阿里云请求器配置、阿里云模型配置、阿里云令牌配置

新增硅基模型配置
2025-02-08 10:27:19 +08:00

22 lines
507 B
Python

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']