智能小说生成器v2.0,支持长篇小说的断点续传、智能上下文管理、三层压缩机制、章节跳转、智能导入设定、AI辅助编辑和记忆管理。当用户需要创作长篇小说、管理复杂故事结构、从外部资源导入设定、或需要AI辅助进行持续性的创意写作时使用此技能。
这是一个专业的长篇小说AI创作辅助技能,具备完整的断点续传、智能上下文管理、分层压缩存储、智能导入和AI辅助编辑功能。
会话管理和断点续传的核心脚本:
python scripts/session_manager.py --action save|load|resume --session-id <session_id>
模式切换脚本:
python scripts/mode_handler.py --mode setting|writing|import --project-path <path>
上下文管理脚本:
python scripts/context_manager.py --action build|clean --chapter <N> --token-limit <128k>
压缩处理脚本:
python scripts/compression_engine.py --action compress|recompress --chapters <range>
统一API接口,整合所有功能:
# 系统状态查看
python scripts/unified_api.py --request-json '{"action": "system.status"}'
# 导入设定(需要AI处理)
python scripts/unified_api.py --request-json '{
"action": "import.from_directory",
"target_directory": "./source_materials"
}'
# 显示设定
python scripts/unified_api.py --request-json '{
"action": "display.setting",
"setting_type": "worldview",
"format_type": "readable"
}'
# 智能章节编辑
python scripts/unified_api.py --request-json '{
"action": "chapter.intelligent_edit",
"chapter_number": 1,
"edit_request": {
"content": "新内容...",
"edit_mode": "append",
"requires_ai": false
}
}'
增强的导入管理器,支持智能扫描和AI分析:
# 扫描目录内容
python scripts/import_manager.py --action scan-directory --target-directory ./source_materials
# 从目录导入(返回AI任务)
python scripts/import_manager.py --action import-from-directory --target-directory ./source_materials
# 处理AI分析结果
python scripts/import_manager.py --action process-ai-result --project-path . [需要AI结果输入]
增强的章节管理器,支持智能编辑:
# 创建章节
python scripts/chapter_manager.py --action create --chapter 1 --title "第一章"
# 智能编辑(本地)
python scripts/chapter_manager.py --action intelligent-edit --chapter 1 --content "新内容" --edit-mode append
# 智能编辑(AI)
python scripts/chapter_manager.py --action intelligent-edit --chapter 1 --requires-ai --edit-instructions "请改进这段文字"
# 上下文更新
python scripts/chapter_manager.py --action context-update --chapter 1 --content "章节重点内容"
设定显示管理器:
# 显示世界观设定
python scripts/settings_display_manager.py --type worldview --format readable
# 显示特定角色
python scripts/settings_display_manager.py --type character --name "张三" --format json
# 显示记忆统计
python scripts/settings_display_manager.py --action list
记忆显示管理器:
# 显示角色所有记忆
python scripts/memory_display_manager.py --identifier "张三" --type character_all
# 显示记忆时间线
python scripts/memory_display_manager.py --identifier "张三" --type timeline
# 显示记忆统计
python scripts/memory_display_manager.py --action stats --identifier "张三"
在实现数据结构和验证时参考,包含所有数据模型的详细定义。
压缩触发时参考,定义三层压缩的具体规则和算法。
上下文管理策略参考,在不同章节位置时如何组装上下文。
包含项目模板、章节模板、设定模板,在创建新项目时使用。
包含优秀示例和演示数据,在用户需要参考时使用。
系统采用"本地处理+AI客户端"架构,当需要AI能力时会返回标准化的AI任务请求:
# 示例:处理导入请求
result = api.process_request({
"action": "import.from_directory",
"target_directory": "./source_materials"
})
if result["status"] == "ai_task_required":
# 获取AI任务
ai_task = result["ai_task"]
# 调用AI服务处理
ai_result = your_ai_client.process_task(ai_task)
# 应用AI结果
final_result = api.process_request({
"action": "import.process_ai_result",
"ai_result": ai_result
})
{
"status": "ai_task_required",
"ai_task": {
"task_type": "content_analysis",
"files": [...],
"analysis_instructions": "请识别世界观、人物、环境等设定",
"supported_settings": ["worldview", "character", "environment"]
}
}