更新系统智能体配置

更新系统智能体在当前工作区中的配置。

PUT https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/system-agent-setups/{agent_id}

调用前准备

准备个人访问令牌、目标工作区 ID 和系统智能体 ID。

请求体

将示例中的 $WORKSPACE_ID、$AGENT_ID、$AI_STUDIO_API_KEY 替换为实际值。

curl -X PUT "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/system-agent-setups/$AGENT_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
  "enabled": true,
  "channels": {
    "repository": {
      "instance_id": "github-instance-id"
    },
    "code_analysis": {
      "instance_id": "codex-instance-id"
    },
    "group_notification": {
      "instance_id": "wecom-group-instance-id"
    }
  },
  "knowledge_bases": {},
  "project_scope": {
    "project_id": "PVT_project_id"
  }
}'

参数

类型

是否必填

说明

workspace_id

string

是

所属工作区 ID。

agent_id

string

是

已更新配置的系统智能体 ID。

请求体

字段

类型

是否必填

说明

enabled

boolean

是

是否启用系统智能体。

channels

object

否

按通道槽位键配置的通道选择。每项可包含 instance_id 或 create。

channels.repository

object

否

仓库名称。

channels.repository.instance_id

string

否

通道实例 ID。不能为空。

channels.repository.create

object

否

新建实例配置。

channels.repository.create.name

string

否

名称。

channels.repository.create.description

string

否

说明。

channels.repository.create.config

object

否

配置。

channels.repository.create.secrets

object

否

凭据配置。

channels.code_analysis

object

否

代码分析槽。

channels.code_analysis.instance_id

string

否

通道实例 ID。不能为空。

channels.code_analysis.create

object

否

新建实例配置。

channels.code_analysis.create.name

string

否

名称。

channels.code_analysis.create.description

string

否

说明。

channels.code_analysis.create.config

object

否

配置。

channels.code_analysis.create.secrets

object

否

凭据配置。

channels.notification

object

否

个人通知槽。

channels.notification.instance_id

string

否

通道实例 ID。不能为空。

channels.notification.create

object

否

新建实例配置。

channels.notification.create.name

string

否

名称。

channels.notification.create.description

string

否

说明。

channels.notification.create.config

object

否

配置。

channels.notification.create.secrets

object

否

凭据配置。

channels.group_notification

object

否

群通知槽。

channels.group_notification.instance_id

string

否

通道实例 ID。不能为空。

channels.group_notification.create

object

否

新建实例配置。

channels.group_notification.create.name

string

否

名称。

channels.group_notification.create.description

string

否

说明。

channels.group_notification.create.config

object

否

配置。

channels.group_notification.create.secrets

object

否

凭据配置。

channels.observability

object

否

观测槽。

channels.observability.instance_id

string

否

通道实例 ID。不能为空。

channels.observability.create

object

否

新建实例配置。

channels.observability.create.name

string

否

名称。

channels.observability.create.description

string

否

说明。

channels.observability.create.config

object

否

配置。

channels.observability.create.secrets

object

否

凭据配置。

channels.kubernetes

object

否

Kubernetes槽。

channels.kubernetes.instance_id

string

否

通道实例 ID。不能为空。

channels.kubernetes.create

object

否

新建实例配置。

channels.kubernetes.create.name

string

否

名称。

channels.kubernetes.create.description

string

否

说明。

channels.kubernetes.create.config

object

否

配置。

channels.kubernetes.create.secrets

object

否

凭据配置。

knowledge_bases

object

否

按知识库槽位键配置的知识库选择。每项可包含 id 或 create。

model

object

否

模型配置,可包含 model_config_ref、default_model 和 params_override。

model.model_config_ref

string

否

模型配置引用。

model.default_model

string

否

默认模型。

model.params_override

object

否

参数覆盖。

project_scope

object

否

项目范围配置。

project_scope.project_id

string

对象提供时

GitHub项目 ID。不能为空。

project_scope.owner

string

否

所有者。

project_scope.owner_type

string

否

所有者类型。

project_scope.number

integer

否

编号。

project_scope.title

string

否

标题。

project_scope.url

string

否

地址。

project_scope.host

string

否

主机。

suites

object(对象数组)

否

多套件命名空间范围。

suites[].suite_id

string

对象提供时

运维套件 ID。

suites[].display_name

string

否

展示名称。

suites[].namespace

string

对象提供时

Kubernetes命名空间。

suites[].log_namespace

string

否

日志命名空间。

suites[].containers

string(字符串数组)

否

容器列表。

suites[].enabled

boolean

否

是否启用。

reconciliation_task

object

否

对账任务配置,包含 cron_expression。

reconciliation_task.cron_expression

string

对象提供时

Cron表达式。不能为空。

当前三个内置智能体均不支持知识库绑定。knowledge_bases 只能省略或填 {},非空对象会被拒绝。

按所选智能体填写必需的通道绑定项,每项在已有 instance_id 和 create 中选择一种。

  • github-issue-operator 必须填写 repository、code_analysis 和 group_notification,notification 可选。

  • github-pr-reviewer 还必须填写 notification。

  • ops-agent 必须填写 observability、kubernetes、repository、code_analysis 和 group_notification,notification 可选。

两个 GitHub 智能体必须填写 project_scope,不接受非空的 suites。ops-agent 必须填写有效的 suites,不支持 project_scope 或 reconciliation_task。必需通道不能用 channels:{} 代替。

通道槽

provider

channel_type

必需配置。

repository

github

github_app

owner、repository。GitHub 智能体还需 callback_signature_configured=true。

code_analysis

codex

codex_api

按实例配置提供 Codex 访问。

notification

wecom

wecom_app

corp_id、agent_id。

group_notification

wecom

wecom_group_robot

群机器人实例配置。

observability

grafana

grafana

grafana_url。

kubernetes

kubernetes

kubernetes

api_server。

create.name 和 description 为字符串,config 和 secrets 为字符串映射。提供方与通道类型由绑定项决定。选择已有实例时,实例须为 active 状态。

省略可选绑定项时,对应工具会被禁用,不会自动保留原绑定。

成功响应

{
  "code": 0,
  "data": {
    "workspace_id": "",
    "agent_id": "agent_01",
    "name": "",
    "description": "",
    "definition": {
      "agent_id": "",
      "name": "",
      "description": "",
      "channel_slots": [],
      "knowledge_slots": []
    },
    "configured": false,
    "enabled": false,
    "channels": {},
    "knowledge_bases": {},
    "model": {},
    "callback_rule_enabled": false,
    "callback_configured": false,
    "callback_enabled": false
  }
}

字段

类型

说明

data.workspace_id

string

所属工作区 ID。

data.agent_id

string

已更新配置的系统智能体 ID。

data.name

string

名称。

data.description

string

说明。

data.definition

object

内置智能体定义。

data.definition.agent_id

string

智能体 ID。

data.definition.name

string

名称。

data.definition.description

string

说明。

data.definition.channel_slots

object(对象数组)

通道槽。

data.definition.channel_slots[].key

string

键。

data.definition.channel_slots[].name

string

名称。

data.definition.channel_slots[].description

string

说明。

data.definition.channel_slots[].provider

string

提供方。取值:wecom、github、feishu、slack、grafana、kubernetes、qq_mail、codex、bocha、tavily、brave。

data.definition.channel_slots[].channel_type

string

通道类型。取值:wecom_app、wecom_group_robot、wecom_mail、github_app、feishu_app、slack_app、grafana、kubernetes、qq_mail、codex_api、bocha_web_search、tavily_web_search、brave_web_search。

data.definition.channel_slots[].required

boolean

是否为必需槽。

data.definition.knowledge_slots

object(对象数组)

知识库槽。

data.definition.knowledge_slots[].key

string

键。

data.definition.knowledge_slots[].name

string

名称。

data.definition.knowledge_slots[].description

string

说明。

data.definition.knowledge_slots[].required

boolean

是否为必需槽。

data.definition.knowledge_slots[].compatible_table_names

string(字符串数组)

兼容的表名称列表。

data.definition.project_scope

object

GitHub项目范围。

data.definition.project_scope.name

string

名称。

data.definition.project_scope.description

string

说明。

data.definition.project_scope.channel_slot_key

string

通道槽键。

data.definition.project_scope.required

boolean

是否为必需槽。

data.definition.suite_scope

object

运维套件范围。

data.definition.suite_scope.name

string

名称。

data.definition.suite_scope.description

string

说明。

data.definition.suite_scope.required

boolean

是否为必需槽。

data.configured

boolean

是否已配置。

data.enabled

boolean

是否启用。

data.channels

object

通道槽配置。

data.channels.repository

object 或 null

仓库名称。

data.channels.repository.id

string

标识。

data.channels.repository.workspace_id

string

所属工作区 ID。

data.channels.repository.provider

string

提供方。取值:wecom、github、feishu、slack、grafana、kubernetes、qq_mail、codex、bocha、tavily、brave。

data.channels.repository.channel_type

string

通道类型。取值:wecom_app、wecom_group_robot、wecom_mail、github_app、feishu_app、slack_app、grafana、kubernetes、qq_mail、codex_api、bocha_web_search、tavily_web_search、brave_web_search。

data.channels.repository.name

string

名称。

data.channels.repository.description

string

说明。

data.channels.repository.status

string

状态。取值:draft、active、disabled、archived。

data.channels.repository.credential_ref

string

凭据引用。

data.channels.repository.callback_path

string

回调路径。

data.channels.repository.capabilities

string(字符串数组)

可用管理动作。

data.channels.repository.tool_ids

string(字符串数组)

工具 ID 列表。

data.channels.repository.config

object

配置。

data.channels.repository.last_test_status

string

最近连接测试状态。取值:succeeded、failed。

data.channels.repository.last_tested_at

string

最近连接测试时间。RFC 3339 时间。

data.channels.repository.last_test_error

string

最近连接测试错误。

data.channels.repository.labels

object

标签映射。

data.channels.repository.created_at

string

创建时间。RFC 3339 时间。

data.channels.repository.updated_at

string

更新时间。RFC 3339 时间。

data.channels.code_analysis

object 或 null

代码分析槽。

data.channels.code_analysis.id

string

标识。

data.channels.code_analysis.workspace_id

string

所属工作区 ID。

data.channels.code_analysis.provider

string

提供方。取值:wecom、github、feishu、slack、grafana、kubernetes、qq_mail、codex、bocha、tavily、brave。

data.channels.code_analysis.channel_type

string

通道类型。取值:wecom_app、wecom_group_robot、wecom_mail、github_app、feishu_app、slack_app、grafana、kubernetes、qq_mail、codex_api、bocha_web_search、tavily_web_search、brave_web_search。

data.channels.code_analysis.name

string

名称。

data.channels.code_analysis.description

string

说明。

data.channels.code_analysis.status

string

状态。取值:draft、active、disabled、archived。

data.channels.code_analysis.credential_ref

string

凭据引用。

data.channels.code_analysis.callback_path

string

回调路径。

data.channels.code_analysis.capabilities

string(字符串数组)

可用管理动作。

data.channels.code_analysis.tool_ids

string(字符串数组)

工具 ID 列表。

data.channels.code_analysis.config

object

配置。

data.channels.code_analysis.last_test_status

string

最近连接测试状态。取值:succeeded、failed。

data.channels.code_analysis.last_tested_at

string

最近连接测试时间。RFC 3339 时间。

data.channels.code_analysis.last_test_error

string

最近连接测试错误。

data.channels.code_analysis.labels

object

标签映射。

data.channels.code_analysis.created_at

string

创建时间。RFC 3339 时间。

data.channels.code_analysis.updated_at

string

更新时间。RFC 3339 时间。

data.channels.notification

object 或 null

个人通知槽。

data.channels.notification.id

string

标识。

data.channels.notification.workspace_id

string

所属工作区 ID。

data.channels.notification.provider

string

提供方。取值:wecom、github、feishu、slack、grafana、kubernetes、qq_mail、codex、bocha、tavily、brave。

data.channels.notification.channel_type

string

通道类型。取值:wecom_app、wecom_group_robot、wecom_mail、github_app、feishu_app、slack_app、grafana、kubernetes、qq_mail、codex_api、bocha_web_search、tavily_web_search、brave_web_search。

data.channels.notification.name

string

名称。

data.channels.notification.description

string

说明。

data.channels.notification.status

string

状态。取值:draft、active、disabled、archived。

data.channels.notification.credential_ref

string

凭据引用。

data.channels.notification.callback_path

string

回调路径。

data.channels.notification.capabilities

string(字符串数组)

可用管理动作。

data.channels.notification.tool_ids

string(字符串数组)

工具 ID 列表。

data.channels.notification.config

object

配置。

data.channels.notification.last_test_status

string

最近连接测试状态。取值:succeeded、failed。

data.channels.notification.last_tested_at

string

最近连接测试时间。RFC 3339 时间。

data.channels.notification.last_test_error

string

最近连接测试错误。

data.channels.notification.labels

object

标签映射。

data.channels.notification.created_at

string

创建时间。RFC 3339 时间。

data.channels.notification.updated_at

string

更新时间。RFC 3339 时间。

data.channels.group_notification

object 或 null

群通知槽。

data.channels.group_notification.id

string

标识。

data.channels.group_notification.workspace_id

string

所属工作区 ID。

data.channels.group_notification.provider

string

提供方。取值:wecom、github、feishu、slack、grafana、kubernetes、qq_mail、codex、bocha、tavily、brave。

data.channels.group_notification.channel_type

string

通道类型。取值:wecom_app、wecom_group_robot、wecom_mail、github_app、feishu_app、slack_app、grafana、kubernetes、qq_mail、codex_api、bocha_web_search、tavily_web_search、brave_web_search。

data.channels.group_notification.name

string

名称。

data.channels.group_notification.description

string

说明。

data.channels.group_notification.status

string

状态。取值:draft、active、disabled、archived。

data.channels.group_notification.credential_ref

string

凭据引用。

data.channels.group_notification.callback_path

string

回调路径。

data.channels.group_notification.capabilities

string(字符串数组)

可用管理动作。

data.channels.group_notification.tool_ids

string(字符串数组)

工具 ID 列表。

data.channels.group_notification.config

object

配置。

data.channels.group_notification.last_test_status

string

最近连接测试状态。取值:succeeded、failed。

data.channels.group_notification.last_tested_at

string

最近连接测试时间。RFC 3339 时间。

data.channels.group_notification.last_test_error

string

最近连接测试错误。

data.channels.group_notification.labels

object

标签映射。

data.channels.group_notification.created_at

string

创建时间。RFC 3339 时间。

data.channels.group_notification.updated_at

string

更新时间。RFC 3339 时间。

data.channels.observability

object 或 null

观测槽。

data.channels.observability.id

string

标识。

data.channels.observability.workspace_id

string

所属工作区 ID。

data.channels.observability.provider

string

提供方。取值:wecom、github、feishu、slack、grafana、kubernetes、qq_mail、codex、bocha、tavily、brave。

data.channels.observability.channel_type

string

通道类型。取值:wecom_app、wecom_group_robot、wecom_mail、github_app、feishu_app、slack_app、grafana、kubernetes、qq_mail、codex_api、bocha_web_search、tavily_web_search、brave_web_search。

data.channels.observability.name

string

名称。

data.channels.observability.description

string

说明。

data.channels.observability.status

string

状态。取值:draft、active、disabled、archived。

data.channels.observability.credential_ref

string

凭据引用。

data.channels.observability.callback_path

string

回调路径。

data.channels.observability.capabilities

string(字符串数组)

可用管理动作。

data.channels.observability.tool_ids

string(字符串数组)

工具 ID 列表。

data.channels.observability.config

object

配置。

data.channels.observability.last_test_status

string

最近连接测试状态。取值:succeeded、failed。

data.channels.observability.last_tested_at

string

最近连接测试时间。RFC 3339 时间。

data.channels.observability.last_test_error

string

最近连接测试错误。

data.channels.observability.labels

object

标签映射。

data.channels.observability.created_at

string

创建时间。RFC 3339 时间。

data.channels.observability.updated_at

string

更新时间。RFC 3339 时间。

data.channels.kubernetes

object 或 null

Kubernetes槽。

data.channels.kubernetes.id

string

标识。

data.channels.kubernetes.workspace_id

string

所属工作区 ID。

data.channels.kubernetes.provider

string

提供方。取值:wecom、github、feishu、slack、grafana、kubernetes、qq_mail、codex、bocha、tavily、brave。

data.channels.kubernetes.channel_type

string

通道类型。取值:wecom_app、wecom_group_robot、wecom_mail、github_app、feishu_app、slack_app、grafana、kubernetes、qq_mail、codex_api、bocha_web_search、tavily_web_search、brave_web_search。

data.channels.kubernetes.name

string

名称。

data.channels.kubernetes.description

string

说明。

data.channels.kubernetes.status

string

状态。取值:draft、active、disabled、archived。

data.channels.kubernetes.credential_ref

string

凭据引用。

data.channels.kubernetes.callback_path

string

回调路径。

data.channels.kubernetes.capabilities

string(字符串数组)

可用管理动作。

data.channels.kubernetes.tool_ids

string(字符串数组)

工具 ID 列表。

data.channels.kubernetes.config

object

配置。

data.channels.kubernetes.last_test_status

string

最近连接测试状态。取值:succeeded、failed。

data.channels.kubernetes.last_tested_at

string

最近连接测试时间。RFC 3339 时间。

data.channels.kubernetes.last_test_error

string

最近连接测试错误。

data.channels.kubernetes.labels

object

标签映射。

data.channels.kubernetes.created_at

string

创建时间。RFC 3339 时间。

data.channels.kubernetes.updated_at

string

更新时间。RFC 3339 时间。

data.knowledge_bases

object

知识库引用。

data.model

object

模型。

data.model.model_config_ref

string

模型配置引用。

data.model.default_model

string

默认模型。

data.model.params_override

object

参数覆盖。

data.skill_refs

object(对象数组)

技能引用。

data.skill_refs[].id

string

标识。

data.skill_refs[].workspace_id

string

所属工作区 ID。

data.skill_refs[].kind

string

类别。取值:skill、tool、knowledge_base。

data.skill_refs[].status

string

状态。

data.skill_refs[].resource_id

string

资源 ID。

data.skill_refs[].name

string

名称。

data.skill_refs[].display_name

string

展示名称。

data.skill_refs[].description

string

说明。

data.skill_refs[].category

string

资源类别。

data.skill_refs[].phase

string

执行阶段。

data.skill_refs[].bindable

boolean

是否可绑定。

data.skill_refs[].bindability_reason

string

绑定可用性说明。

data.skill_refs[].supported_runtimes

string(字符串数组)

支持的运行环境。

data.skill_refs[].config

object

配置。

data.skill_refs[].runtime_tool_visibility

string

运行工具可见性。

data.skill_refs[].binding_source

string

绑定来源。

data.skill_refs[].manageable

boolean

是否可管理。

data.project_scope

object

GitHub项目范围。

data.project_scope.project_id

string

GitHub项目 ID。

data.project_scope.owner

string

所有者。

data.project_scope.owner_type

string

所有者类型。

data.project_scope.number

integer

编号。

data.project_scope.title

string

标题。

data.project_scope.url

string

地址。

data.project_scope.host

string

主机。

data.suites

object(对象数组)

运维检查项。

data.suites[].suite_id

string

运维套件 ID。

data.suites[].display_name

string

展示名称。

data.suites[].namespace

string

Kubernetes命名空间。

data.suites[].log_namespace

string

日志命名空间。

data.suites[].containers

string(字符串数组)

容器列表。

data.suites[].enabled

boolean

是否启用。

data.reconciliation_task

object

协调任务。

data.reconciliation_task.id

string

标识。

data.reconciliation_task.status

string

状态。取值:draft、creating、active、failed、disabled、archived。

data.reconciliation_task.cron_expression

string

Cron表达式。

data.capacity_patrol_task

object

容量巡检任务。

data.capacity_patrol_task.id

string

标识。

data.capacity_patrol_task.status

string

状态。取值:draft、creating、active、failed、disabled、archived。

data.capacity_patrol_task.cron_expression

string

Cron表达式。

data.automation_task_id

string

自动化任务 ID。

data.automation_task_status

string

自动化任务状态。取值:draft、creating、active、failed、disabled、archived。

data.callback_rule_id

string

回调规则 ID。

data.callback_rule_enabled

boolean

回调规则是否启用。

data.callback_configured

boolean

回调是否已配置。

data.callback_enabled

boolean

回调是否启用。

错误响应

{
  "code": 2,
  "message": "invalid setup"
}

路径参数:workspace_id 为目标工作区 ID,agent_id 为要更新的系统智能体 ID。两者必须与 URL 和 X-Workspace-ID 请求头一致。

最后更新于