-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add MiniMax M3 provider defaults #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,8 +29,8 @@ const API_PROVIDER_ID = "minimax"; | |
| const PORTAL_PROVIDER_ID = "minimax-portal"; | ||
| const PROVIDER_LABEL = "MiniMax"; | ||
| const DEFAULT_MODEL = MINIMAX_DEFAULT_MODEL_ID; | ||
| const DEFAULT_BASE_URL_CN = "https://api.minimaxi.com/anthropic"; | ||
| const DEFAULT_BASE_URL_GLOBAL = "https://api.minimax.io/anthropic"; | ||
| const DEFAULT_BASE_URL_CN = "https://api.minimaxi.com/anthropic/v1"; | ||
| const DEFAULT_BASE_URL_GLOBAL = "https://api.minimax.io/anthropic/v1"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# 检查下游测试文件中是否仍有旧的 baseUrl 断言
rg -n 'api\.minimax\.io/anthropic"' src/commands/onboard-auth.test.ts
# 检查下游测试文件中是否仍有旧的 MiniMax-M2.7 默认模型断言
rg -n 'MiniMax-M2\.7' src/commands/onboard-auth.test.tsRepository: linuxhsj/openclaw-zero-token Length of output: 888 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) 定位实现与测试,确认 baseUrl 的实际生成逻辑和相关断言
rg -n 'DEFAULT_BASE_URL_(CN|GLOBAL)|applyMinimaxApiConfig|baseUrl' minimax/index.ts src/commands/onboard-auth.test.ts
# 2) 只读取相关小片段,避免整文件过大输出
sed -n '1,120p' minimax/index.ts
printf '\n--- onboard-auth.test.ts excerpt ---\n'
sed -n '370,440p' src/commands/onboard-auth.test.tsRepository: linuxhsj/openclaw-zero-token Length of output: 10325 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 找出 applyMinimaxApiConfig 的实现和它默认写入 baseUrl 的位置
rg -n 'function applyMinimaxApiConfig|export .*applyMinimaxApiConfig|baseUrl: .*anthropic|DEFAULT_BASE_URL_GLOBAL|DEFAULT_BASE_URL_CN' -S .
# 只读相关实现片段
printf '\n--- plugin-sdk/minimax.js / onboard.ts candidates ---\n'
fd -a 'minimax.*' .
fd -a 'onboard.*' .Repository: linuxhsj/openclaw-zero-token Length of output: 22472 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 读取 applyMinimaxApiConfig 的实现,确认它是否使用了新的 /v1 默认值
sed -n '1,180p' minimax/onboard.ts
printf '\n--- src/commands/onboard-auth.test.ts excerpt ---\n'
sed -n '380,435p' src/commands/onboard-auth.test.ts
printf '\n--- extensions/minimax/onboard.test.ts excerpt ---\n'
sed -n '1,120p' extensions/minimax/onboard.test.tsRepository: linuxhsj/openclaw-zero-token Length of output: 9171 同步更新
🤖 Prompt for AI Agents |
||
|
|
||
| function getDefaultBaseUrl(region: MiniMaxRegion): string { | ||
| return region === "cn" ? DEFAULT_BASE_URL_CN : DEFAULT_BASE_URL_GLOBAL; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,18 +2,17 @@ import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-s | |
| import { MINIMAX_DEFAULT_MODEL_ID, MINIMAX_TEXT_MODEL_CATALOG } from "./provider-models.js"; | ||
|
|
||
| export const DEFAULT_MINIMAX_BASE_URL = "https://api.minimax.io/v1"; | ||
| export const MINIMAX_API_BASE_URL = "https://api.minimax.io/anthropic"; | ||
| export const MINIMAX_CN_API_BASE_URL = "https://api.minimaxi.com/anthropic"; | ||
| export const MINIMAX_API_BASE_URL = "https://api.minimax.io/anthropic/v1"; | ||
| export const MINIMAX_CN_API_BASE_URL = "https://api.minimaxi.com/anthropic/v1"; | ||
| export const MINIMAX_HOSTED_MODEL_ID = MINIMAX_DEFAULT_MODEL_ID; | ||
| export const MINIMAX_HOSTED_MODEL_REF = `minimax/${MINIMAX_HOSTED_MODEL_ID}`; | ||
| export const DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800; | ||
| export const DEFAULT_MINIMAX_CONTEXT_WINDOW = 1000000; | ||
| export const DEFAULT_MINIMAX_MAX_TOKENS = 131072; | ||
|
|
||
| export const MINIMAX_API_COST = { | ||
| input: 0.3, | ||
| output: 1.2, | ||
| cacheRead: 0.06, | ||
| cacheWrite: 0.375, | ||
| input: 0.6, | ||
| output: 2.4, | ||
| cacheRead: 0.12, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# 搜索下游代码中对 MINIMAX_API_COST.cacheWrite 的引用
rg -n 'cacheWrite' minimax/ src/ --type=ts -g '!**/*.test.ts' -g '!**/node_modules/**'
# 搜索 MINIMAX_API_COST 的所有使用点
rg -n 'MINIMAX_API_COST' minimax/ src/ --type=ts -g '!**/node_modules/**'Repository: linuxhsj/openclaw-zero-token Length of output: 32636 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n## minimax/model-definitions.ts\n'
cat -n minimax/model-definitions.ts | sed -n '1,120p'
printf '\n## minimax/provider-catalog.ts\n'
cat -n minimax/provider-catalog.ts | sed -n '1,120p'
printf '\n## minimax/api.ts\n'
cat -n minimax/api.ts | sed -n '1,120p'
printf '\n## minimax/model-definitions.test.ts\n'
cat -n minimax/model-definitions.test.ts | sed -n '1,120p'
printf '\n## minimax files outline\n'
ast-grep outline minimax/model-definitions.ts --view expanded
ast-grep outline minimax/provider-catalog.ts --view expandedRepository: linuxhsj/openclaw-zero-token Length of output: 9212 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n## ModelDefinitionConfig / cost types\n'
rg -n 'interface ModelDefinitionConfig|type ModelDefinitionConfig|cost:' src minimax -g '!**/*.test.ts' -g '!**/node_modules/**'
printf '\n## config defaults / merge logic around cost\n'
rg -n 'DEFAULT_MODEL_COST|cacheWrite.*cost|raw\.cost|cost\.cacheWrite|merge.*cost' src minimax -g '!**/*.test.ts' -g '!**/node_modules/**'
printf '\n## minimax-specific cost references\n'
rg -n 'MINIMAX_API_COST|MINIMAX_HOSTED_COST|MINIMAX_LM_STUDIO_COST|cacheWrite' minimax -g '!**/*.test.ts' -g '!**/node_modules/**'Repository: linuxhsj/openclaw-zero-token Length of output: 23160 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n## src/config/types.models.ts\n'
cat -n src/config/types.models.ts | sed -n '58,90p'
printf '\n## src/config/defaults.ts\n'
cat -n src/config/defaults.ts | sed -n '30,90p'
printf '\n--\n'
cat -n src/config/defaults.ts | sed -n '260,285p'
printf '\n## src/utils/usage-format.ts\n'
cat -n src/utils/usage-format.ts | sed -n '235,265p'
printf '\n## minimax/model-definitions.ts references\n'
rg -n 'MINIMAX_API_COST|MINIMAX_HOSTED_COST|MINIMAX_LM_STUDIO_COST' minimax src -g '!**/*.test.ts' -g '!**/node_modules/**'Repository: linuxhsj/openclaw-zero-token Length of output: 6265 补上
🤖 Prompt for AI Agents |
||
| }; | ||
| export const MINIMAX_HOSTED_COST = { | ||
| input: 0, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: linuxhsj/openclaw-zero-token
Length of output: 1497
🏁 Script executed:
Repository: linuxhsj/openclaw-zero-token
Length of output: 50385
🏁 Script executed:
Repository: linuxhsj/openclaw-zero-token
Length of output: 23693
🏁 Script executed:
Repository: linuxhsj/openclaw-zero-token
Length of output: 50385
🏁 Script executed:
Repository: linuxhsj/openclaw-zero-token
Length of output: 1273
🏁 Script executed:
Repository: linuxhsj/openclaw-zero-token
Length of output: 4117
补回
cacheWrite字段extensions/minimax/model-definitions.ts:12-15里的MINIMAX_API_COST少了cacheWrite,但它会被传给要求完整ModelDefinitionConfig["cost"]的位置,当前会产生类型不匹配。🤖 Prompt for AI Agents