阅读时间:1 分钟
0 字

智能体 API

智能体 API 负责管理实际对话主体。

常见接口

  • GET /ai/agent
  • POST /ai/agent
  • GET /ai/agent/{id}
  • PUT /ai/agent/{id}
  • GET /ai/agent/tool
  • GET /ai/agent/chat/{code}/sessions/{id}/messages

字段表

字段是否必填说明
name智能体名称
code智能体编码
model_id绑定模型 ID
instructions系统提示词
tools工具列表
settings扩展配置
active是否启用
description说明

settings 常见字段

字段说明
temperature模型温度
summary_max_tokens会话摘要最大 Token
summary_messages_keep会话保留消息数量
debug_enabled是否开启调试
bot_codes绑定机器人编码列表

创建请求示例

json
{
  "name": "客服助手",
  "code": "customer_service",
  "model_id": 1,
  "instructions": "你是一个专业的客服助手,回答要简洁准确。",
  "tools": [],
  "settings": {
    "temperature": 0.7,
    "bot_codes": ["corp_service_bot"]
  },
  "active": true,
  "description": "用于官网和机器人客服"
}

校验规则

  • 智能体主模型应使用 chat 类型
  • bot_codes 不能和其他智能体重复绑定
  • 工具列表允许先挂载,后续继续补配置