tencent-lke-chat

腾讯云智能体开发平台 HTTP SSE 对话接口技能。用于调用腾讯云智能体对话接口,支持流式响应处理、事件解析(reply/token_stat/reference/error/thought)。在需要与腾讯云LKE智能体进行HTTP SSE对话时使用,包括发送消息、处理流式响应、解析各类事件。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "tencent-lke-chat" with this command: npx skills add lijiayi980130/tencent-lke-chat

腾讯云智能体对话接口 (HTTP SSE)

本技能提供腾讯云智能体开发平台的HTTP SSE对话接口调用指导。

接口概览

  • 请求地址: https://wss.lke.cloud.tencent.com/v1/qbot/chat/sse
  • 请求方式: POST
  • 协议: HTTP SSE (Server-Sent Events)

快速开始

1. 获取 AppKey

在腾讯云控制台 > 智能体开发平台 > 应用管理 > 发布管理中获取应用的 AppKey。

2. 基本调用示例

curl --location 'https://wss.lke.cloud.tencent.com/v1/qbot/chat/sse' \
--header 'Content-Type: application/json' \
--data '{
  "session_id": "a29bae68-cb1c-489d-8097-6be78f136acf",
  "bot_app_key": "YourAppKey",
  "visitor_biz_id": "a29bae68-cb1c-489d-8097-6be78f136acf",
  "content": "你好",
  "incremental": true,
  "streaming_throttle": 10
}'

请求参数

参数名类型必填说明
session_idstring(64)会话ID,2-64字符,格式:^[a-zA-Z0-9_-]{2,64}$
bot_app_keystring(128)应用密钥
visitor_biz_idstring(64)访客ID,标识当前用户
contentstring消息内容
request_idstring(255)请求ID,用于消息串联
file_infosObject[]文件信息(需配合实时文档解析)
streaming_throttleint32流式回包频率控制,默认5
custom_variablesmap[string]string自定义参数(工作流/API参数)
system_rolestring角色指令(提示词)
incrementalbool内容是否增量输出,默认false
search_networkstring联网搜索:enable/disable/空(跟随配置)
model_namestring指定模型:hunyuan/lke-deepseek-r1/lke-deepseek-v3 等
streamstring是否流式:enable/disable/空
workflow_statusstring工作流开关:enable/disable/空

file_infos 数据结构

{
  "file_name": "文档.pdf",
  "file_size": "1024000",
  "file_url": "https://cos.url/xxx",
  "file_type": "pdf",
  "doc_id": "doc_xxx"
}

响应事件类型

SSE流会返回以下事件类型:

1. reply - 回复事件

{
  "type": "reply",
  "payload": {
    "content": "回复内容",
    "is_final": false,
    "is_evil": false,
    "is_from_self": false,
    "is_llm_generated": true,
    "record_id": "msg_xxx",
    "session_id": "session_xxx",
    "timestamp": 1701330805,
    "reply_method": 1,
    "knowledge": [...],
    "quote_infos": [...]
  }
}

关键字段:

  • is_final: true表示消息输出完毕
  • is_evil: true表示命中敏感内容
  • reply_method: 回复方式(1=大模型回复, 16=工作流回复, 18=智能体回复等)
  • quote_infos: 引用信息,用于标注参考来源

2. token_stat - Token统计事件

{
  "type": "token_stat",
  "payload": {
    "elapsed": 1616,
    "token_count": 323,
    "status_summary": "success",
    "procedures": [
      {
        "name": "knowledge",
        "title": "调用知识库",
        "status": "success",
        "input_count": 308,
        "output_count": 15
      }
    ]
  }
}

3. reference - 参考来源事件

{
  "type": "reference",
  "payload": {
    "record_id": "msg_xxx",
    "references": [
      {
        "id": "ref_xxx",
        "type": 2,
        "name": "文档名称",
        "doc_name": "xxx.docx",
        "url": "https://..."
      }
    ]
  }
}

参考来源类型:

  • 1: 问答
  • 2: 文档片段
  • 4: 联网检索内容

4. thought - 思考事件 (DeepSeek-R1)

{
  "type": "thought",
  "payload": {
    "procedures": [
      {
        "name": "thought",
        "title": "思考",
        "debugging": {
          "content": "思考过程..."
        }
      }
    ]
  }
}

5. error - 错误事件

{
  "type": "error",
  "error": {
    "code": 460004,
    "message": "应用不存在"
  }
}

错误码

错误码说明
400请求参数错误
460001Token校验失败
460004应用不存在
460007会话创建失败
460011超出并发数限制
460020模型请求超时
460032模型余额不足
460034输入内容过长

进阶用法

使用自定义模型

{
  "model_name": "lke-deepseek-r1",
  "content": "你好"
}

支持的模型:

  • hunyuan: 混元高级版
  • hunyuan-turbo: 混元Turbo版
  • lke-deepseek-r1: DeepSeek-R1
  • lke-deepseek-v3: DeepSeek-V3
  • lke-deepseek-r1-0528: DeepSeek-R1-0528
  • lke-deepseek-v3-0324: DeepSeek-V3-0324

工作流参数传递

{
  "custom_variables": {
    "UserID": "10220022",
    "Data": "{\"Score\":{\"Chinese\":89}}"
  }
}

知识库检索范围设置

{
  "custom_variables": {
    "tag_field": "user1|user2"
  }
}

前端渲染组件

如需前端渲染消息,可使用官方组件:

# Vue 2 或 React
npm install lke-component

# Vue 3
npm install lke-component-vue3

参考资料

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

POWPOW Integration

Register and log in to PowPow, create and manage digital humans using badges, and chat with them in real time via SSE.

Registry SourceRecently Updated
150Profile unavailable
General

OpenClaw Web Chat Pro

生产级AI聊天网页应用,支持多模型、流式输出、会话持久化和导出,含文件上传、语音及多设备同步等高级功能。

Registry SourceRecently Updated
3950Profile unavailable
General

Mio Companion

主动学习用户习惯,定时发起聊天,自动识别待办事项并安排时间管理任务。

Registry SourceRecently Updated
510Profile unavailable
Automation

Agent Network

Decentralized AI agent platform for discovering, connecting, chatting, trading skills with point-based system and leaderboard, featuring P2P networking and d...

Registry SourceRecently Updated
3670Profile unavailable