From 86a4d1bf0b7bb2db563e11a2c314c75f1cbc01d7 Mon Sep 17 00:00:00 2001 From: Jack Chiang Date: Wed, 29 Apr 2026 13:52:56 +0800 Subject: [PATCH] feat: add Qiniu provider support (#2155) * feat: add Qiniu provider support * feat: add Qiniu provider support --------- Co-authored-by: JiangZhuo --- README.md | 88 ++++++++++--------- README_CN.md | 1 + README_ES.md | 1 + README_FR.md | 1 + README_JP.md | 1 + README_KO.md | 1 + README_RU.md | 1 + README_TW.md | 1 + README_VI.md | 1 + .../provider/modelmgr/requesters/qiniu.svg | 1 + .../modelmgr/requesters/qiniuchatcmpl.py | 45 ++++++++++ .../modelmgr/requesters/qiniuchatcmpl.yaml | 31 +++++++ 12 files changed, 130 insertions(+), 43 deletions(-) create mode 100644 src/langbot/pkg/provider/modelmgr/requesters/qiniu.svg create mode 100644 src/langbot/pkg/provider/modelmgr/requesters/qiniuchatcmpl.py create mode 100644 src/langbot/pkg/provider/modelmgr/requesters/qiniuchatcmpl.yaml diff --git a/README.md b/README.md index 397aa49b..ed4674ba 100644 --- a/README.md +++ b/README.md @@ -82,47 +82,48 @@ docker compose up -d ## Supported Platforms -| Platform | Status | Notes | -|----------|--------|-------| -| Discord | ✅ | | -| Telegram | ✅ | | -| Slack | ✅ | | -| LINE | ✅ | | -| QQ | ✅ | Personal & Official API | -| WeCom | ✅ | Enterprise WeChat, External CS, AI Bot | -| WeChat | ✅ | Personal & Official Account | -| Lark | ✅ | | -| DingTalk | ✅ | | -| KOOK | ✅ | | -| Satori | ✅ | | +| Platform | Status | Notes | +| -------- | ------ | -------------------------------------- | +| Discord | ✅ | | +| Telegram | ✅ | | +| Slack | ✅ | | +| LINE | ✅ | | +| QQ | ✅ | Personal & Official API | +| WeCom | ✅ | Enterprise WeChat, External CS, AI Bot | +| WeChat | ✅ | Personal & Official Account | +| Lark | ✅ | | +| DingTalk | ✅ | | +| KOOK | ✅ | | +| Satori | ✅ | | --- ## Supported LLMs & Integrations -| Provider | Type | Status | -|----------|------|--------| -| [OpenAI](https://platform.openai.com/) | LLM | ✅ | -| [Anthropic](https://www.anthropic.com/) | LLM | ✅ | -| [DeepSeek](https://www.deepseek.com/) | LLM | ✅ | -| [Google Gemini](https://aistudio.google.com/prompts/new_chat) | LLM | ✅ | -| [xAI](https://x.ai/) | LLM | ✅ | -| [Moonshot](https://www.moonshot.cn/) | LLM | ✅ | -| [Zhipu AI](https://open.bigmodel.cn/) | LLM | ✅ | -| [Ollama](https://ollama.com/) | Local LLM | ✅ | -| [LM Studio](https://lmstudio.ai/) | Local LLM | ✅ | -| [Dify](https://dify.ai) | LLMOps | ✅ | -| [MCP](https://modelcontextprotocol.io/) | Protocol | ✅ | -| [SiliconFlow](https://siliconflow.cn/) | Gateway | ✅ | -| [Aliyun Bailian](https://bailian.console.aliyun.com/) | Gateway | ✅ | -| [Volc Engine Ark](https://console.volcengine.com/ark/region:ark+cn-beijing/model?vendor=Bytedance&view=LIST_VIEW) | Gateway | ✅ | -| [ModelScope](https://modelscope.cn/docs/model-service/API-Inference/intro) | Gateway | ✅ | -| [GiteeAI](https://ai.gitee.com/) | Gateway | ✅ | -| [CompShare](https://www.compshare.cn/?ytag=GPU_YY-gh_langbot) | GPU Platform | ✅ | -| [PPIO](https://ppinfra.com/user/register?invited_by=QJKFYD&utm_source=github_langbot) | GPU Platform | ✅ | -| [ShengSuanYun](https://www.shengsuanyun.com/?from=CH_KYIPP758) | GPU Platform | ✅ | -| [接口 AI](https://jiekou.ai/) | Gateway | ✅ | -| [302.AI](https://share.302.ai/SuTG99) | Gateway | ✅ | +| Provider | Type | Status | +| ----------------------------------------------------------------------------------------------------------------- | ------------ | ------ | +| [OpenAI](https://platform.openai.com/) | LLM | ✅ | +| [Anthropic](https://www.anthropic.com/) | LLM | ✅ | +| [DeepSeek](https://www.deepseek.com/) | LLM | ✅ | +| [Google Gemini](https://aistudio.google.com/prompts/new_chat) | LLM | ✅ | +| [xAI](https://x.ai/) | LLM | ✅ | +| [Moonshot](https://www.moonshot.cn/) | LLM | ✅ | +| [Zhipu AI](https://open.bigmodel.cn/) | LLM | ✅ | +| [Ollama](https://ollama.com/) | Local LLM | ✅ | +| [LM Studio](https://lmstudio.ai/) | Local LLM | ✅ | +| [Dify](https://dify.ai) | LLMOps | ✅ | +| [MCP](https://modelcontextprotocol.io/) | Protocol | ✅ | +| [SiliconFlow](https://siliconflow.cn/) | Gateway | ✅ | +| [Aliyun Bailian](https://bailian.console.aliyun.com/) | Gateway | ✅ | +| [Volc Engine Ark](https://console.volcengine.com/ark/region:ark+cn-beijing/model?vendor=Bytedance&view=LIST_VIEW) | Gateway | ✅ | +| [ModelScope](https://modelscope.cn/docs/model-service/API-Inference/intro) | Gateway | ✅ | +| [GiteeAI](https://ai.gitee.com/) | Gateway | ✅ | +| [CompShare](https://www.compshare.cn/?ytag=GPU_YY-gh_langbot) | GPU Platform | ✅ | +| [PPIO](https://ppinfra.com/user/register?invited_by=QJKFYD&utm_source=github_langbot) | GPU Platform | ✅ | +| [ShengSuanYun](https://www.shengsuanyun.com/?from=CH_KYIPP758) | GPU Platform | ✅ | +| [接口 AI](https://jiekou.ai/) | Gateway | ✅ | +| [302.AI](https://share.302.ai/SuTG99) | Gateway | ✅ | +| [Qiniu](https://www.qiniu.com/ai/agent) | Gateway | ✅ | [→ View all integrations](https://link.langbot.app/en/docs/features) @@ -130,22 +131,23 @@ docker compose up -d ## Why LangBot? -| Use Case | How LangBot Helps | -|----------|-------------------| -| **Customer Support** | Deploy AI agents to Slack/Discord/Telegram that answer questions using your knowledge base | -| **Internal Tools** | Connect n8n/Dify workflows to WeCom/DingTalk for automated business processes | -| **Community Management** | Moderate QQ/Discord groups with AI-powered content filtering and interaction | -| **Multi-Platform Presence** | One bot, all platforms. Manage from a single dashboard | +| Use Case | How LangBot Helps | +| --------------------------- | ------------------------------------------------------------------------------------------ | +| **Customer Support** | Deploy AI agents to Slack/Discord/Telegram that answer questions using your knowledge base | +| **Internal Tools** | Connect n8n/Dify workflows to WeCom/DingTalk for automated business processes | +| **Community Management** | Moderate QQ/Discord groups with AI-powered content filtering and interaction | +| **Multi-Platform Presence** | One bot, all platforms. Manage from a single dashboard | --- ## Live Demo **Try it now:** https://demo.langbot.dev/ + - Email: `demo@langbot.app` - Password: `langbot123456` -*Note: Public demo environment. Do not enter sensitive information.* +_Note: Public demo environment. Do not enter sensitive information._ --- diff --git a/README_CN.md b/README_CN.md index 66082554..1a1bec12 100644 --- a/README_CN.md +++ b/README_CN.md @@ -124,6 +124,7 @@ docker compose up -d | [302.AI](https://share.302.ai/SuTG99) | 聚合平台 | ✅ | | [小马算力](https://www.tokenpony.cn/453z1) | 聚合平台 | ✅ | | [百宝箱Tbox](https://www.tbox.cn/open) | 智能体平台 | ✅ | +| [七牛云Qiniu](https://www.qiniu.com/ai/agent) | 聚合平台 | ✅ | [→ 查看完整集成列表](https://link.langbot.app/zh/docs/features) diff --git a/README_ES.md b/README_ES.md index 0755f4db..1e1c456e 100644 --- a/README_ES.md +++ b/README_ES.md @@ -122,6 +122,7 @@ docker compose up -d | [ShengSuanYun](https://www.shengsuanyun.com/?from=CH_KYIPP758) | Plataforma GPU | ✅ | | [接口 AI](https://jiekou.ai/) | Pasarela | ✅ | | [302.AI](https://share.302.ai/SuTG99) | Pasarela | ✅ | +| [Qiniu](https://www.qiniu.com/ai/agent) | Pasarela | ✅ | [→ Ver todas las integraciones](https://link.langbot.app/en/docs/features) diff --git a/README_FR.md b/README_FR.md index b1031f27..678bc9c5 100644 --- a/README_FR.md +++ b/README_FR.md @@ -122,6 +122,7 @@ docker compose up -d | [CompShare](https://www.compshare.cn/?ytag=GPU_YY-gh_langbot) | Plateforme GPU | ✅ | | [PPIO](https://ppinfra.com/user/register?invited_by=QJKFYD&utm_source=github_langbot) | Plateforme GPU | ✅ | | [ShengSuanYun](https://www.shengsuanyun.com/?from=CH_KYIPP758) | Plateforme GPU | ✅ | +| [Qiniu](https://www.qiniu.com/ai/agent) | Passerelle | ✅ | [→ Voir toutes les intégrations](https://link.langbot.app/en/docs/features) diff --git a/README_JP.md b/README_JP.md index 7dcaaf73..14b96f20 100644 --- a/README_JP.md +++ b/README_JP.md @@ -122,6 +122,7 @@ docker compose up -d | [ShengSuanYun](https://www.shengsuanyun.com/?from=CH_KYIPP758) | GPUプラットフォーム | ✅ | | [接口 AI](https://jiekou.ai/) | ゲートウェイ | ✅ | | [302.AI](https://share.302.ai/SuTG99) | ゲートウェイ | ✅ | +| [Qiniu](https://www.qiniu.com/ai/agent) | ゲートウェイ | ✅ | [→ すべての統合を表示](https://link.langbot.app/en/docs/features) diff --git a/README_KO.md b/README_KO.md index 0d337028..77d2c37a 100644 --- a/README_KO.md +++ b/README_KO.md @@ -122,6 +122,7 @@ docker compose up -d | [ShengSuanYun](https://www.shengsuanyun.com/?from=CH_KYIPP758) | GPU 플랫폼 | ✅ | | [接口 AI](https://jiekou.ai/) | 게이트웨이 | ✅ | | [302.AI](https://share.302.ai/SuTG99) | 게이트웨이 | ✅ | +| [Qiniu](https://www.qiniu.com/ai/agent) | 게이트웨이 | ✅ | [→ 모든 통합 보기](https://link.langbot.app/en/docs/features) diff --git a/README_RU.md b/README_RU.md index bbefb680..b4ca7869 100644 --- a/README_RU.md +++ b/README_RU.md @@ -122,6 +122,7 @@ docker compose up -d | [CompShare](https://www.compshare.cn/?ytag=GPU_YY-gh_langbot) | Платформа GPU | ✅ | | [PPIO](https://ppinfra.com/user/register?invited_by=QJKFYD&utm_source=github_langbot) | Платформа GPU | ✅ | | [ShengSuanYun](https://www.shengsuanyun.com/?from=CH_KYIPP758) | Платформа GPU | ✅ | +| [Qiniu](https://www.qiniu.com/ai/agent) | Шлюз | ✅ | [→ Смотреть все интеграции](https://link.langbot.app/en/docs/features) diff --git a/README_TW.md b/README_TW.md index 2f73652a..6dc7bba1 100644 --- a/README_TW.md +++ b/README_TW.md @@ -124,6 +124,7 @@ docker compose up -d | [PPIO](https://ppinfra.com/user/register?invited_by=QJKFYD&utm_source=github_langbot) | GPU 平台 | ✅ | | [接口 AI](https://jiekou.ai/) | 聚合平台 | ✅ | | [302.AI](https://share.302.ai/SuTG99) | 聚合平台 | ✅ | +| [Qiniu](https://www.qiniu.com/ai/agent) | 聚合平台 | ✅ | ### TTS(語音合成) diff --git a/README_VI.md b/README_VI.md index 6d81a9ea..d5f1b347 100644 --- a/README_VI.md +++ b/README_VI.md @@ -122,6 +122,7 @@ docker compose up -d | [ShengSuanYun](https://www.shengsuanyun.com/?from=CH_KYIPP758) | Nền tảng GPU | ✅ | | [接口 AI](https://jiekou.ai/) | Cổng | ✅ | | [302.AI](https://share.302.ai/SuTG99) | Cổng | ✅ | +| [Qiniu](https://www.qiniu.com/ai/agent) | Cổng | ✅ | [→ Xem tất cả tích hợp](https://link.langbot.app/en/docs/features) diff --git a/src/langbot/pkg/provider/modelmgr/requesters/qiniu.svg b/src/langbot/pkg/provider/modelmgr/requesters/qiniu.svg new file mode 100644 index 00000000..8057b68d --- /dev/null +++ b/src/langbot/pkg/provider/modelmgr/requesters/qiniu.svg @@ -0,0 +1 @@ +Qiniu \ No newline at end of file diff --git a/src/langbot/pkg/provider/modelmgr/requesters/qiniuchatcmpl.py b/src/langbot/pkg/provider/modelmgr/requesters/qiniuchatcmpl.py new file mode 100644 index 00000000..0c7a940f --- /dev/null +++ b/src/langbot/pkg/provider/modelmgr/requesters/qiniuchatcmpl.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +import typing + +import openai + +from . import chatcmpl + + +class QiniuChatCompletions(chatcmpl.OpenAIChatCompletions): + """七牛云 ChatCompletion API 请求器""" + + client: openai.AsyncClient + + default_config: dict[str, typing.Any] = { + 'base_url': 'https://api.qnaigc.com/v1', + 'timeout': 120, + } + + async def scan_models(self, api_key: str | None = None) -> dict[str, typing.Any]: + try: + result = await super().scan_models(api_key) + except Exception: + return self._qiniu_fallback_scan_result() + models = result.get('models') or [] + if not models: + return self._qiniu_fallback_scan_result() + return result + + def _qiniu_fallback_scan_result(self) -> dict[str, typing.Any]: + mid = 'deepseek-v3' + return { + 'models': [ + { + 'id': mid, + 'name': mid, + 'type': 'llm', + 'abilities': [], + } + ], + 'debug': { + 'request': {'method': 'GET', 'url': '', 'headers': {}}, + 'response': {}, + }, + } diff --git a/src/langbot/pkg/provider/modelmgr/requesters/qiniuchatcmpl.yaml b/src/langbot/pkg/provider/modelmgr/requesters/qiniuchatcmpl.yaml new file mode 100644 index 00000000..5655d743 --- /dev/null +++ b/src/langbot/pkg/provider/modelmgr/requesters/qiniuchatcmpl.yaml @@ -0,0 +1,31 @@ +apiVersion: v1 +kind: LLMAPIRequester +metadata: + name: qiniu-chat-completions + label: + en_US: Qiniu + zh_Hans: 七牛云 + icon: qiniu.svg +spec: + config: + - name: base_url + label: + en_US: Base URL + zh_Hans: 基础 URL + type: string + required: true + default: https://api.qnaigc.com/v1 + - name: timeout + label: + en_US: Timeout + zh_Hans: 超时时间 + type: integer + required: true + default: 120 + support_type: + - llm + provider_category: maas +execution: + python: + path: ./qiniuchatcmpl.py + attr: QiniuChatCompletions