feat: add moonshot provider

This commit is contained in:
yetone
2025-07-16 19:04:11 +08:00
parent 18ea95d965
commit ae06698c30
3 changed files with 35 additions and 0 deletions

View File

@@ -101,6 +101,15 @@ For building binary if you wish to build from source, then `cargo` is required.
max_tokens = 20480,
},
},
moonshot = {
endpoint = "https://api.moonshot.ai/v1",
model = "kimi-k2-0711-preview",
timeout = 30000, -- Timeout in milliseconds
extra_request_body = {
temperature = 0.75,
max_tokens = 32768,
},
},
},
},
dependencies = {
@@ -714,6 +723,7 @@ Given its early stage, `avante.nvim` currently supports the following basic func
> export AVANTE_GEMINI_API_KEY=your-gemini-api-key
> export AVANTE_CO_API_KEY=your-cohere-api-key
> export AVANTE_AIHUBMIX_API_KEY=your-aihubmix-api-key
> export AVANTE_MOONSHOT_API_KEY=your-moonshot-api-key
> ```
>
> **Global API Keys (Legacy)**

View File

@@ -79,6 +79,15 @@
max_tokens = 20480,
},
},
moonshot = {
endpoint = "https://api.moonshot.ai/v1",
model = "kimi-k2-0711-preview",
timeout = 30000, -- 超时时间(毫秒)
extra_request_body = {
temperature = 0.75,
max_tokens = 32768,
},
},
},
},
dependencies = {
@@ -315,6 +324,15 @@ _请参见 [config.lua#L9](./lua/avante/config.lua) 以获取完整配置_
max_tokens = 4096,
},
},
moonshot = {
endpoint = "https://api.moonshot.ai/v1",
model = "kimi-k2-0711-preview",
timeout = 30000, -- 超时时间(毫秒)
extra_request_body = {
temperature = 0.75,
max_tokens = 32768,
},
},
},
---指定特殊的 dual_boost 模式
---1. enabled: 是否启用 dual_boost 模式。默认为 false。
@@ -545,6 +563,7 @@ _请参见 [config.lua#L9](./lua/avante/config.lua) 以获取完整配置_
> export AVANTE_GEMINI_API_KEY=your-gemini-api-key
> export AVANTE_CO_API_KEY=your-cohere-api-key
> export AVANTE_AIHUBMIX_API_KEY=your-aihubmix-api-key
> export AVANTE_MOONSHOT_API_KEY=your-moonshot-api-key
> ```
>
> **全局 API 密钥(传统方式)**

View File

@@ -401,6 +401,12 @@ M._defaults = {
model = "auto",
api_key_name = "MORPH_API_KEY",
},
moonshot = {
__inherited_from = "openai",
endpoint = "https://api.moonshot.ai/v1",
model = "kimi-k2-0711-preview",
api_key_name = "MOONSHOT_API_KEY",
},
},
---Specify the special dual_boost mode
---1. enabled: Whether to enable dual_boost mode. Default to false.