跳到主要内容

进行 Agent 问答对话

POST 

/v1/aibot/bots/:botId/send-message

进行 Agent 问答对话

Request

Path Parameters

    botId stringrequired

    Agent ID

    Example: bot-xxx

Body

required
    msg stringrequired

    用户发送信息

    history object[]

    历史对话信息

  • Array [
  • role stringrequired

    历史信息角色

    content stringrequired

    历史信息内容

  • ]
  • searchEnable boolean

    是否启用联网查询,当且仅当 Agent 配置的 searchEnable 与本字段都为 true 时,才开启联网搜索

Responses

Agent 对话成功时返回, 返回格式为 SSE 格式

Response Headers
  • X-Request-Id string

    请求ID

Schema
    created number

    对话时间戳

    record_id string

    对话记录ID

    model string

    大模型类型

    version string

    大模型版本

    type string

    回复类型: text: 主要回答内容,thinking: 思考过程,search: 查询结果,knowledge: 知识库

    role string

    对话角色,响应中固定为 assistant

    content string

    对话内容

    finish_reasion string

    对话结束标志,continue 表示对话未结束,stop 表示对话结束

    reasoning_content string

    深度思考内容(仅deepseek-r1是不为空字符串)

    usage object

    token使用量

    prompt_tokens number

    表示prompt的tokens数,多次返回中保持不变

    completion_tokens number

    回答的token总数,在流式返回中,表示到目前为止所有completion的tokens总数,多次返回中持续累加

    total_tokens number

    表示prompt_tokens和completion_tokens之和

    knowledge_base string[]

    对话中使用到的知识库

    search_info object

    搜索结果信息,需要开启联网查询

    search_results undefined[]

    搜索引文信息

  • Array [
  • index string

    搜索引文序号

    title string

    搜索引文标题

    url string

    搜索引文链接

  • ]
Loading...