qianfan-chat

千帆AI应用对话接口调用技能。用于调用百度千帆平台的对话API进行AI对话交互。支持流式和非流式响应、Function Call工具调用、文件上传等功能。触发场景:(1) 用户需要调用千帆对话API;(2) 用户提到"千帆"、"qianfan"、"百度AI对话";(3) 需要与千帆应用进行对话交互。

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 "qianfan-chat" with this command: npx skills add lilitong9607/baidu-qianfan-agent-chat

千帆对话技能

调用百度千帆平台的对话API,与千帆AI应用进行对话交互。

初始化配置

⚠️ 必须设置环境变量 QIANFAN_API_KEY

export QIANFAN_API_KEY="your-api-key-here"

API Key 可从 千帆平台 获取。

默认配置

配置项默认值说明
app_ide52a2419-4327-48e8-b9dc-9bf037199fc2应用ID,可在调用时通过 --app-id 覆盖
streamfalse流式返回

接口详情

详细的请求/响应参数、错误码、curl 示例等,请参阅 API 参考文档


基本用法

发起对话

使用 scripts/chat.py 脚本调用:

python3 scripts/chat.py --query "你好,请介绍一下自己"

参数说明

参数说明默认值
--query用户提问内容(必选)-
--app-id应用IDe52a2419-4327-48e8-b9dc-9bf037199fc2
--stream是否流式返回true
--conversation-id会话ID(多轮对话时传入)-
--file-ids文件ID列表,逗号分隔-

多轮对话

会话状态自动管理:

  • 首次调用不传 conversation_id,API返回后会自动保存
  • 后续调用自动使用已保存的 conversation_id
  • 使用 --new-session 开始新会话
# 首次对话(自动保存 conversation_id)
python3 scripts/chat.py --query "你好"
# 输出: [conversation_id: xxx-xxx-xxx]

# 后续对话(自动使用已保存的 conversation_id)
python3 scripts/chat.py --query "刚才我们聊了什么"
# 输出: [使用已保存的会话: xxx-xxx-xxx]

# 开始新会话
python3 scripts/chat.py --query "新话题" --new-session

手动指定会话ID:

python3 scripts/chat.py --query "继续" --conversation-id "xxx-xxx-xxx"

非流式响应

python3 scripts/chat.py --query "你好" --stream false

高级功能

Function Call

定义工具并上报结果:

python3 scripts/chat.py --query "今天北京天气" --tools-file tools/weather.json

注意事项

  1. 确保 QIANFAN_API_KEY 环境变量已设置
  2. 首次对话不需要 conversation_id,后续多轮对话需传入
  3. 流式模式下,响应以 data: 开头,以 data: [DONE] 结束

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

Multi Edge-TTS CN

Edge-TTS 在线语音合成 skill。基于微软 Edge TTS 引擎,生成速度快(1-2秒),支持多种音色和输出格式。同时支持飞书(OGG/Opus)和企业微信(AMR)。默认音色 xiaoxiao_lively。需联网。

Registry SourceRecently Updated
General

vedic-destiny

吠陀命盘分析中文入口。用于完整命盘研判、命主盘 Rashi chart 与九分盘 Navamsha chart 联读、既往事件回看、出生时间稳定度判断、事业主题、婚姻主题、时空盘专题,以及基于 Jagannatha Hora PDF、星盘截图或文本命盘数据的系统拆盘。当用户提到完整星盘、事业方向、婚姻问题、关系窗...

Registry SourceRecently Updated
General

One Person Company OS

Build a visual operating cockpit for an AI-native one-person company across promise, buyer, product, delivery, cash, learning, and assets. / 为 AI 一人公司建立可视化经营...

Registry SourceRecently Updated
General

健康追踪

健康追踪技能 - 追踪饮水、睡眠、步数等健康数据,JSON存储。

Registry SourceRecently Updated