mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-04 12:56:02 +00:00
22 lines
515 B
Python
22 lines
515 B
Python
from __future__ import annotations
|
|
|
|
import openai
|
|
|
|
from . import chatcmpl
|
|
from .. import requester
|
|
from ....core import app
|
|
|
|
|
|
@requester.requester_class("lmstudio-chat-completions")
|
|
class LmStudioChatCompletions(chatcmpl.OpenAIChatCompletions):
|
|
"""LMStudio 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']['lmstudio-chat-completions']
|