第一步:新建agent

创建名为“zhangsan”的agent

openclaw agents add  zhangsan

按操作步骤创建即可。

第二步:修改配置文件openclaw.json

在配置文件中的 agents 部分,为每个Agent添加 model 字段,指定其使用的模型。以下是一个配置示例:

{
  "agents": {
    "list": [
      {
        "id": "main",
        "name": "个人助理",
        "workspace": "~/.openclaw/workspace-main",
        // 没有指定 model,将使用默认模型
      },
      {
        "id": "coding",
        "name": "编程助手",
        "workspace": "~/.openclaw/workspace-coding",
        "model": {
          "primary": "anthropic/claude-sonnet-4-5" // 为 coding 助手指定 Claude 模型
        }
      },
      {
        "id": "alerts",
        "name": "监控报警",
        "workspace": "~/.openclaw/workspace-alerts",
        "model": {
          "primary": "openai/gpt-5.2-mini" // 为 alerts 助手指定轻量级模型,节省成本
        }
      }
    ]
  }}

在编辑完配置文件后,需要重启OpenClaw网关服务使配置生效

重启网关的命令:

openclaw gateway restart

分类: 人工智能Openclaw 标签: 暂无标签

评论

暂无评论数据

暂无评论数据

目录