mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-18 03:34:20 +00:00
9eefbcb6f2
新增阿里云请求器配置、阿里云模型配置、阿里云令牌配置 新增硅基模型配置
22 lines
507 B
Python
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']
|