fix: 错误输出
This commit is contained in:
parent
ab9895e9ca
commit
6854f83c54
@ -94,17 +94,14 @@ argument-hint: "需要 prompt 参数(画图提示词),可选 model(模
|
||||
2. 从用户输入中提取 prompt(画图提示词),不对提示词做总结或修改。可选提取 model、negative_prompt、ratio、resolution 参数。
|
||||
3. 在执行脚本前,先安装依赖:`python3 skills/text-to-image/scripts/bootstrap.py`。
|
||||
4. 将参数组装为 JSON 字符串,在仓库根目录下执行本地脚本:`python3 text-to-image/scripts/text_to_image.py '<JSON参数>'`。
|
||||
5. 脚本内部执行逻辑:
|
||||
- 连接 MySQL 数据库(数据库名 = `ROBOT_CODE`)。
|
||||
- 查询 `global_settings` 表获取全局绘图配置(`image_ai_enabled`、`image_ai_settings`)。
|
||||
- 如果 `ROBOT_FROM_WX_ID` 以 `@chatroom` 结尾,查询 `chat_room_settings` 表(`WHERE chat_room_id = ?`)覆盖全局配置;否则查询 `friend_settings` 表(`WHERE wechat_id = ?`)覆盖全局配置。
|
||||
- 检查绘图功能是否开启(`image_ai_enabled`)。
|
||||
- 解析 `image_ai_settings` JSON,根据选择的模型提取对应配置(JiMeng / DouBao / Z-Image)。
|
||||
- 调用对应的绘图 API 生成图片。
|
||||
- 输出图片 URL。
|
||||
6. 如果脚本执行失败,回复兜底文案:`AI 绘图暂时不可用,请稍后再试。`
|
||||
5. 成功是脚本输出
|
||||
|
||||
```
|
||||
<wechat-robot-image-url>图片URL1</wechat-robot-image-url>
|
||||
<wechat-robot-image-url>图片URL2</wechat-robot-image-url>
|
||||
```
|
||||
|
||||
## 回复要求
|
||||
|
||||
- 成功时,脚本输出 `<wechat-robot-image-url>图片URL</wechat-robot-image-url>` 格式,直接发送图片,不要额外追加解释文字。
|
||||
- 失败时,使用固定兜底文案回复。
|
||||
- 成功时,脚本输出 `<wechat-robot-image-url>图片URL1</wechat-robot-image-url><wechat-robot-image-url>图片URL2</wechat-robot-image-url>` 格式,AI 智能体接受到这种格式内容会自动发送图片。
|
||||
- 失败时,返回具体的失败信息。
|
||||
|
||||
Loading…
Reference in New Issue
Block a user