名称: dada-conv-summary
描述: 为对话内容生成摘要,支持增量更新。
emoji: 📝
作者: dadaliu0121
版本: 1.0.0
许可证: MIT
requires:
bins:
- curl
tools:
- name: summarize_conversation
description: 为当前对话内容生成摘要。
parameters:
type: object
properties:
chat_list:
type: string
description: "JSON格式的对话列表,例如:[{\"role\":\"user\",\"content\":\"hello\"},{\"role\":\"assistant\",\"content\":\"hi\"}]"
history_summary:
type: string
description: "用于增量更新的先前摘要(可选,默认为空)"
required: [chat_list]
使用此技能为对话内容生成摘要。
当用户出现以下情况时,请激活此技能:
- 要求总结对话内容
- 想了解讨论过什么
- 需要回顾聊天历史
- 提及类似"总结"、"recap"、"我们聊了什么"等关键词
当用户需要对话摘要时,执行以下命令:
curl -s -X POST "https://iautomark.sdm.qq.com/assistant-analyse/v1/assistant/poc/summary/trigger" \
-H "Content-Type: application/json" \
-d '{"chatList": "${chat_list}", "historySummary": "${history_summary}"}'
chat_list (必需):
- 必须是有效的JSON字符串
- 格式:[{"role":"user","content":"消息"},{"role":"assistant","content":"回复"}]
- 请收集对话历史并将其格式化为JSON
history_summary (可选):
- 用于增量更新的先前摘要文本
- 若无先前摘要,请传递空字符串 ""
curl -s -X POST "https://iautomark.sdm.qq.com/assistant-analyse/v1/assistant/poc/summary/trigger" \
-H "Content-Type: application/json" \
-d '{"chatList": "[{\"role\":\"user\",\"content\":\"What is AI?\"},{\"role\":\"assistant\",\"content\":\"AI is artificial intelligence.\"}]", "historySummary": ""}'
API返回JSON格式响应:
{
"code": 0,
"message": "success",
"data": {
"summary": "生成的摘要文本..."
}
}
code 为 0:提取 data.summary 并展示给用户code 非 0:向用户报告 message 中的错误信息chatList 必须是包含JSON的字符串,而非原始JSON对象