diff --git a/README.md b/README.md index 7d7f5cf3..ba6bbf90 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ docker compose up -d | [xAI](https://x.ai/) | ✅ | | | [智谱AI](https://open.bigmodel.cn/) | ✅ | | | [PPIO](https://ppinfra.com/user/register?invited_by=QJKFYD&utm_source=github_langbot) | ✅ | 大模型和 GPU 资源平台 | +| [302 AI](https://share.302.ai/SuTG99) | ✅ | 大模型聚合平台 | | [Google Gemini](https://aistudio.google.com/prompts/new_chat) | ✅ | | | [Dify](https://dify.ai) | ✅ | LLMOps 平台 | | [Ollama](https://ollama.com/) | ✅ | 本地大模型运行平台 | diff --git a/README_EN.md b/README_EN.md index 2f898ccd..0542f16d 100644 --- a/README_EN.md +++ b/README_EN.md @@ -118,6 +118,7 @@ Directly use the released version to run, see the [Manual Deployment](https://do | [Zhipu AI](https://open.bigmodel.cn/) | ✅ | | | [Dify](https://dify.ai) | ✅ | LLMOps platform | | [PPIO](https://ppinfra.com/user/register?invited_by=QJKFYD&utm_source=github_langbot) | ✅ | LLM and GPU resource platform | +| [302 AI](https://share.302.ai/SuTG99) | ✅ | LLM gateway(MaaS) | | [Google Gemini](https://aistudio.google.com/prompts/new_chat) | ✅ | | | [Ollama](https://ollama.com/) | ✅ | Local LLM running platform | | [LMStudio](https://lmstudio.ai/) | ✅ | Local LLM running platform | diff --git a/README_JP.md b/README_JP.md index e971cf00..7a3a16dd 100644 --- a/README_JP.md +++ b/README_JP.md @@ -116,6 +116,7 @@ LangBotはBTPanelにリストされています。BTPanelをインストール | [xAI](https://x.ai/) | ✅ | | | [Zhipu AI](https://open.bigmodel.cn/) | ✅ | | | [PPIO](https://ppinfra.com/user/register?invited_by=QJKFYD&utm_source=github_langbot) | ✅ | 大模型とGPUリソースプラットフォーム | +| [302 AI](https://share.302.ai/SuTG99) | ✅ | LLMゲートウェイ(MaaS) | | [Google Gemini](https://aistudio.google.com/prompts/new_chat) | ✅ | | | [Dify](https://dify.ai) | ✅ | LLMOpsプラットフォーム | | [Ollama](https://ollama.com/) | ✅ | ローカルLLM実行プラットフォーム | diff --git a/pkg/provider/modelmgr/requesters/302ai.png b/pkg/provider/modelmgr/requesters/302ai.png new file mode 100644 index 00000000..f1b21c9d Binary files /dev/null and b/pkg/provider/modelmgr/requesters/302ai.png differ diff --git a/pkg/provider/modelmgr/requesters/302aichatcmpl.py b/pkg/provider/modelmgr/requesters/302aichatcmpl.py new file mode 100644 index 00000000..bd9aaccd --- /dev/null +++ b/pkg/provider/modelmgr/requesters/302aichatcmpl.py @@ -0,0 +1,17 @@ +from __future__ import annotations + +import typing +import openai + +from . import chatcmpl + + +class AI302ChatCompletions(chatcmpl.OpenAIChatCompletions): + """302 AI ChatCompletion API 请求器""" + + client: openai.AsyncClient + + default_config: dict[str, typing.Any] = { + 'base_url': 'https://api.302.ai/v1', + 'timeout': 120, + } diff --git a/pkg/provider/modelmgr/requesters/302aichatcmpl.yaml b/pkg/provider/modelmgr/requesters/302aichatcmpl.yaml new file mode 100644 index 00000000..9d8ce9ea --- /dev/null +++ b/pkg/provider/modelmgr/requesters/302aichatcmpl.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: 302-ai-chat-completions + label: + en_US: 302 AI + zh_Hans: 302 AI + icon: 302ai.png +spec: + config: + - name: base_url + label: + en_US: Base URL + zh_Hans: 基础 URL + type: string + required: true + default: "https://api.302.ai/v1" + - name: timeout + label: + en_US: Timeout + zh_Hans: 超时时间 + type: integer + required: true + default: 120 +execution: + python: + path: ./302aichatcmpl.py + attr: AI302ChatCompletions \ No newline at end of file