Files
story-skill/bridge/SKILL.md

49 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: novelist-bridge
description: 调用小说家 agent 进行小说风格续写。自动复制小说原文到 novelist 工作区。
---
# Novelist Bridge
通过 Gateway API 同步调用 `novelist` agent 进行小说创作。
**自动将小说原文复制到 novelist 工作区**,让 novelist 能在本地直接读取原文正文,而不是仅靠标题推断。
适用于任意调用方 Agent(如聊天机器人、工作流引擎等)通过 Gateway 调用 novelist。
## 用法
```bash
# 基本用法(自动查找默认小说文件)
python scripts/ask_novelist.py "续写请求内容"
# 指定小说文件路径
python scripts/ask_novelist.py --novel /path/to/novel.txt "续写请求内容"
# 从 stdin 读取
echo "续写内容" | python scripts/ask_novelist.py
```
## 配置
修改 `ask_novelist.py` 顶部的常量:
| 变量 | 说明 |
|------|------|
| `GATEWAY_URL` | Gateway API 地址 |
| `GATEWAY_TOKEN` | Gateway API Token |
| `NOVELIST_MODEL` | novelist agent model ID |
| `NOVELIST_WORKSPACE` | novelist 工作区路径 |
| `NOVEL_TARGET_NAME` | 复制到工作区后的文件名 |
## 调用链路
```
caller agent → ask_novelist.py → 复制小说到 novelist 工作区 → Gateway API → novelist agent → 回复
```
## 注意事项
- 超时默认 180 秒
- 如果 novelist 正在忙,会排队等待
- 脚本自动跳过已存在的相同文件(按文件大小比对),减少磁盘写操作