mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-08 10:37:14 +00:00
b02c9517f6
Adding a Kimi/Moonshot provider failed model scanning out of the box for CN-region API keys: the single preset defaulted its base URL to the global endpoint `https://api.moonshot.ai/v1`, but CN-issued keys are only valid against `https://api.moonshot.cn/v1`, so scanning returned `401 Invalid Authentication`. Flipping the default would just move the breakage to international keys, since the base_url field is plain free-text and either region is equally common. Instead, offer two clearly labelled presets, mirroring how the Lark adapter exposes feishu.cn vs larksuite.com: - `moonshot-chat-completions` -> "Moonshot / Kimi (Global · api.moonshot.ai)" - `moonshot-cn-chat-completions` -> "Moonshot / Kimi (China · api.moonshot.cn)" The existing component name is kept unchanged so provider rows already in the DB keep resolving; only its display label is clarified. Both presets keep base_url as a free-text field, so users behind a proxy / one-api gateway can still enter a custom endpoint. Both carry the same `kimi` search aliases so either shows up when searching. Fixes #2232
34 lines
795 B
YAML
34 lines
795 B
YAML
apiVersion: v1
|
||
kind: LLMAPIRequester
|
||
metadata:
|
||
name: moonshot-chat-completions
|
||
label:
|
||
en_US: Moonshot / Kimi (Global · api.moonshot.ai)
|
||
zh_Hans: 月之暗面 / Kimi(国际站 · api.moonshot.ai)
|
||
icon: moonshot.png
|
||
spec:
|
||
litellm_provider: openai
|
||
config:
|
||
- name: base_url
|
||
label:
|
||
en_US: Base URL
|
||
zh_Hans: 基础 URL
|
||
type: string
|
||
required: true
|
||
default: https://api.moonshot.ai/v1
|
||
- name: timeout
|
||
label:
|
||
en_US: Timeout
|
||
zh_Hans: 超时时间
|
||
type: integer
|
||
required: true
|
||
default: 120
|
||
alias: "moonshot Moonshot 月之暗面 月暗 kimi Kimi 月之 暗面 moonshot-v1 k2"
|
||
support_type:
|
||
- llm
|
||
provider_category: manufacturer
|
||
execution:
|
||
python:
|
||
path: ./moonshotchatcmpl.py
|
||
attr: MoonshotChatCompletions
|