Skip to content

Commit 406bb6c

Browse files
authored
fix: warn instead of blocking when configured model not in hardcoded list (#7692)
* fix: change highspeed model block to warning instead of ValueError * fix: add highspeed models + use astrbot logger (per AI review) * style: fix ruff format (line-length, import grouping)
1 parent fb16e12 commit 406bb6c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

astrbot/core/provider/sources/minimax_token_plan_source.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
from astrbot import logger
12
from astrbot.core.provider.sources.anthropic_source import ProviderAnthropic
23

34
from ..register import register_provider_adapter
45

56
MINIMAX_TOKEN_PLAN_MODELS = [
67
"MiniMax-M2.7",
8+
"MiniMax-M2.7-highspeed",
79
"MiniMax-M2.5",
10+
"MiniMax-M2.5-highspeed",
811
"MiniMax-M2.1",
12+
"MiniMax-M2.1-highspeed",
913
"MiniMax-M2",
1014
]
1115

@@ -43,9 +47,13 @@ def __init__(
4347

4448
configured_model = provider_config.get("model", "MiniMax-M2.7")
4549
if configured_model not in MINIMAX_TOKEN_PLAN_MODELS:
46-
raise ValueError(
47-
f"Unsupported model: {configured_model!r}. "
48-
f"Supported models: {', '.join(MINIMAX_TOKEN_PLAN_MODELS)}"
50+
logger.warning(
51+
f"Configured model {configured_model!r} is not in the known "
52+
f"Token Plan model list "
53+
f"({', '.join(MINIMAX_TOKEN_PLAN_MODELS)}). "
54+
f"The model may still work if your plan supports it. "
55+
f"If you encounter errors, please check your plan's "
56+
f"model availability."
4957
)
5058

5159
self.set_model(configured_model)

0 commit comments

Comments
 (0)