config:修改默认模型配置支持v4

This commit is contained in:
SengokuCola
2026-05-02 19:55:39 +08:00
parent 6326019390
commit b54e8981ef
3 changed files with 25 additions and 32 deletions

View File

@@ -57,7 +57,7 @@ MODEL_CONFIG_PATH: Path = (CONFIG_DIR / "model_config.toml").resolve().absolute(
LEGACY_ENV_PATH: Path = (PROJECT_ROOT / ".env").resolve().absolute()
MMC_VERSION: str = "1.0.0"
CONFIG_VERSION: str = "8.9.20"
MODEL_CONFIG_VERSION: str = "1.14.3"
MODEL_CONFIG_VERSION: str = "1.14.5"
logger = get_logger("config")

View File

@@ -11,26 +11,29 @@ DEFAULT_PROVIDER_TEMPLATES: list[dict[str, Any]] = [
"base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"api_key": "your-api-key",
"auth_type": OpenAICompatibleAuthType.BEARER.value,
"max_retry": 3,
"timeout": 100,
"retry_interval": 8,
}
]
DEFAULT_TASK_CONFIG_TEMPLATES: dict[str, dict[str, Any]] = {
"utils": {
"model_list": ["qwen3.5-35b-a3b-nonthink"],
"model_list": ["deepseek-v4-flash"],
"max_tokens": 4096,
"temperature": 0.5,
"slow_threshold": 15.0,
"selection_strategy": "random",
},
"replyer": {
"model_list": ["ali-glm-5"],
"model_list": ["deepseek-v4-pro-think", "deepseek-v4-pro-nonthink"],
"max_tokens": 4096,
"temperature": 1,
"slow_threshold": 120.0,
"selection_strategy": "random",
},
"planner": {
"model_list": ["qwen3.5-35b-a3b", "qwen3.5-122b-a10b", "qwen3.5-flash"],
"model_list": ["deepseek-v4-flash"],
"max_tokens": 8000,
"temperature": 0.7,
"slow_threshold": 12.0,
@@ -61,40 +64,30 @@ DEFAULT_TASK_CONFIG_TEMPLATES: dict[str, dict[str, Any]] = {
DEFAULT_MODEL_TEMPLATES: list[dict[str, Any]] = [
{
"model_identifier": "glm-5",
"name": "ali-glm-5",
"model_identifier": "deepseek-v4-pro",
"name": "deepseek-v4-pro-think",
"api_provider": "BaiLian",
"price_in": 3.0,
"price_out": 14.0,
"temperature": 1.0,
"price_in": 12.0,
"price_out": 24.0,
"visual": False,
"extra_params": {"enable_thinking": False},
"extra_params": {"enable_thinking": "True"},
},
{
"model_identifier": "qwen3.5-122b-a10b",
"name": "qwen3.5-122b-a10b",
"model_identifier": "deepseek-v4-pro",
"name": "deepseek-v4-pro-nonthink",
"api_provider": "BaiLian",
"price_in": 0.8,
"price_out": 6.4,
"visual": True,
"price_in": 12.0,
"price_out": 24.0,
"visual": False,
"extra_params": {"enable_thinking": "false"},
},
{
"model_identifier": "qwen3.5-35b-a3b",
"name": "qwen3.5-35b-a3b",
"model_identifier": "deepseek-v4-flash",
"name": "deepseek-v4-flash",
"api_provider": "BaiLian",
"price_in": 0.4,
"price_out": 3.2,
"visual": True,
"extra_params": {},
},
{
"model_identifier": "qwen3.5-35b-a3b",
"name": "qwen3.5-35b-a3b-nonthink",
"api_provider": "BaiLian",
"price_in": 0.4,
"price_out": 3.2,
"visual": True,
"price_in": 1.0,
"price_out": 2.0,
"visual": False,
"extra_params": {"enable_thinking": "false"},
},
{

View File

@@ -172,7 +172,7 @@ class APIProvider(ConfigBase):
"""工具参数解析模式。可选值:`auto`、`strict`、`repair`、`double_decode`。"""
max_retry: int = Field(
default=2,
default=3,
ge=0,
json_schema_extra={
"x-widget": "input",
@@ -182,7 +182,7 @@ class APIProvider(ConfigBase):
"""最大重试次数 (单个模型API调用失败, 最多重试的次数)"""
timeout: int = Field(
default=10,
default=60,
ge=1,
json_schema_extra={
"x-widget": "input",
@@ -193,7 +193,7 @@ class APIProvider(ConfigBase):
"""API调用的超时时长 (超过这个时长, 本次请求将被视为"请求超时", 单位: 秒)"""
retry_interval: int = Field(
default=10,
default=5,
ge=1,
json_schema_extra={
"x-widget": "input",