跳到主要内容

获取指定 Agent

本接口用于获取指定 Agent 的详细信息,包括基本信息、配置和状态等。

请求方法

POST:https://数据中心域名/v3/agent/get.json

签名规则:所有服务端 API 请求均需要进行规则校验,详见 API 请求签名

请求参数

HTTP 请求正文数据格式为 application/json,支持以下参数:

参数类型必传说明
agentIdStringAgent 唯一标识,长度 3–64 个字符。

请求示例

HTTP
POST /v3/agent/get.json HTTP/1.1
Host: api.rong-api.com
App-Key: e0x9wycfx7flq
Nonce: 1068826355
Timestamp: 1741248603
Signature: 5c6b3f0deb891623b2e8bcef577bc4782a067ea8
Content-Type: application/json

{
"agentId": "customer_service_v1"
}

返回结果

HTTP 响应正文包含具有以下结构的 JSON 对象:

参数类型说明
codeInt返回码,200 表示处理成功。
agentIdStringAgent 唯一标识。
nameStringAgent 名称。
descriptionStringAgent 描述。
typeStringAgent 类型,当前仅支持 chat
statusStringAgent 状态:
- active:活跃
- inactive:非活跃
- draft:草稿
agentConfigObjectAgent 配置对象,详见 Agent 数据模型
createdAtLong创建时间的 Unix 时间戳(毫秒)。
updatedAtLong最近更新时间的 Unix 时间戳(毫秒)。

返回结果示例

HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Request-ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXX

{
"code": 200,
"agentId": "customer_service_v1",
"name": "智能客服助手",
"description": "专业的客服 AI 助手,能够处理各种客户咨询",
"type": "chat",
"status": "active",
"createdAt": 1677652288000,
"updatedAt": 1677652288000,
"agentConfig": {
"model": {
"name": "qwen-turbo",
"options": {
"temperature": 0.7,
"topP": 0.9,
"maxTokens": 2048,
"frequencyPenalty": 0.1,
"presencePenalty": 0.1
}
},
"prompt": {
"instructions": "你是一个专业的客服助手"
},
"memory": {
"strategy": "sliding_window",
"maxMessages": 20
}
}
}

错误码

详见 错误码说明