newapi 刚刚更新了参数覆盖功能,支持了更多语义操作,要实现批量移除、增加、替换参数更加方便了。

举个例子,某渠道支持多个 DeepSeek 模型,但是默认不开启思考,需要配置 thinking 参数

想要通过识别 -think 模型后缀自动添加上思考参数,我们可以这么写:

{
  "operations": [
    {
      "path": "thinking.type",
      "mode": "set",
      "value": "enabled",
      "conditions": [
        { "path": "model", "mode": "prefix", "value": "DeepSeek-" },
        { "path": "model", "mode": "suffix", "value": "-think" }
      ],
      "logic": "AND"
    },
    {
      "path": "model",
      "mode": "trim_suffix",
      "value": "-think",
      "conditions": [
        { "path": "model", "mode": "prefix", "value": "DeepSeek-" },
        { "path": "model", "mode": "suffix", "value": "-think" }
      ],
      "logic": "AND"
    }
  ]
}

这样通过 DeepSeek-V3.1-think / DeepSeek-V3.1-Terminus-think / DeepSeek-V3.2-think / DeepSeek-V3.2-Exp-think 调用的时候就能自动转义了。
批量增加 / 移除模型名称前缀之类的操作也很简单,就不再赘述了,放个官方例子参考:

{"operations":[{"path":"model","mode":"trim_prefix","value":"openai/"}]}

📌 转载信息
原作者:
zhong_little
转载时间:
2026/1/3 15:37:25

标签: API配置, newapi, 参数覆盖, 语义操作, DeepSeek模型

添加新评论