feat: add LangBot Space ChatCompletions requester and integrate with ModelsDialog and EmbeddingForm components

This commit is contained in:
Junyan Qin
2025-12-30 21:52:52 +08:00
parent 19f417174c
commit 197258ae91
7 changed files with 124 additions and 72 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,17 @@
from __future__ import annotations
import typing
import openai
from . import chatcmpl
class LangBotSpaceChatCompletions(chatcmpl.OpenAIChatCompletions):
"""LangBot Space ChatCompletion API 请求器"""
client: openai.AsyncClient
default_config: dict[str, typing.Any] = {
'base_url': 'https://api.langbot.cloud/v1',
'timeout': 120,
}

View File

@@ -0,0 +1,32 @@
apiVersion: v1
kind: LLMAPIRequester
metadata:
name: space-chat-completions
label:
en_US: Space
zh_Hans: Space
icon: space.webp
spec:
config:
- name: base_url
label:
en_US: Base URL
zh_Hans: 基础 URL
type: string
required: true
default: https://api.langbot.cloud/v1
- name: timeout
label:
en_US: Timeout
zh_Hans: 超时时间
type: integer
required: true
default: 120
support_type:
- llm
- text-embedding
provider_category: maas
execution:
python:
path: ./spacechatcmpl.py
attr: LangBotSpaceChatCompletions