mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-09 23:36:02 +00:00
22 lines
512 B
Python
22 lines
512 B
Python
from __future__ import annotations
|
|
|
|
import openai
|
|
|
|
from ....core import app
|
|
from . import chatcmpl
|
|
from .. import requester
|
|
|
|
|
|
@requester.requester_class("zhipuai-chat-completions")
|
|
class ZhipuAIChatCompletions(chatcmpl.OpenAIChatCompletions):
|
|
"""智谱AI 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']['zhipuai-chat-completions']
|