feat: add supports for zhipuai(chatglm)

This commit is contained in:
Junyan Qin
2025-01-06 20:27:10 +08:00
parent 8ed07b8d1a
commit 44b92909eb
8 changed files with 142 additions and 128 deletions
@@ -0,0 +1,21 @@
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']