AI数字克隆技能。Re:live——与所爱之人再次聊天。输入聊天记录、图片、音频等素材,复制一个人的...
该技能是一项面向实际任务的技能。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
同时注意输入完整性、执行条件和输出可用性。从功能定位来看,该技能强调把分散的操作要求整理成清晰、可复用的处理流程,使用户能够围绕既定目标快速准备输入、选择执行方式并获得结构化结果。实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;
若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
Re:Live 将一个人复制为数字克隆体:人格(通过聊天记录 → profile.md)、声音(参考音频 + CosyVoice3)、以及可选的外观(视频首帧)。输出形式支持 文本 / 语音 / 视频。对话内容将持久化保存在对应角色目录下,并用于双通道 RAG 检索。执行方式:从此技能根目录运行 python main.py 。详见 README.md。
运行环境(必需):始终在本技能目录中创建的虚拟环境中运行
python main.py ...,并在该环境中安装所有依赖项,尤其是语音 / 视频合成相关依赖。典型配置步骤(从workspace/skills/relive目录执行):
# Windows(PowerShell): ..venvScriptsActivate.ps1 # Linux/macOS: source .venv/bin/activate
当用户说“和 Martha 聊天”或使用 /relive:Martha 时:
.openclaw/workspace/skills/relive/storage/default_Martha/profile.md,作为回复风格的基础依据。.openclaw/workspace/skills/relive):get_context.json(含 user_id、target_id、content = 用户消息)→ 执行 python main.py get_context.json,将返回的上下文用于辅助生成。synthesize.json(content = 回复文本,user_message = 用户消息,output_mode = text/voice/video)→ 执行 python main.py synthesize.json,完成持久化并可选输出语音/视频。新建角色:参见下方“2. 创建新角色”;流程顺序为:init → upload → export_md → 人格分析 → 编写 profile.md → 添加至 USER.md。
当用户表达类似“克隆/复制某人”、“为已故亲人创建数字孪生体”或“基于聊天记录和语音创建 AI 人格”等意图时,启动 新建角色 流程。
storage/{user_id}_{target_id}/voice_profile/ 目录,并 必须 向用户提供该音频的文字转录稿;将其保存为同目录下的 corresponding.txt 文件。reference_image_url.txt 文件,仅含一行内容——一个公开可访问的 URL 地址,用于 output_mode: "video" 场景。角色根目录为:storage/{user_id}_{target_id}/(例如 storage/default_Martha/)。
所有命令均须从 技能根目录 执行。若用户未提供聊天记录,可直接询问角色特质并跳至第 4 步。
步骤 1:初始化目录
{ "type": "init", "user_id": "default", "target_id": "Martha" }
执行:python main.py init.json(或先写入 init.json 再运行;后续同理)。
步骤 2:上传聊天记录
{
"type": "upload",
"user_id": "default",
"target_id": "Martha",
"file_path": "/absolute/or/relative/path/filename.json",
"file_type": "json",
"self_name": "Jonas",
"target_name": "Martha"
}
self_name / target_name 必须 完全匹配 聊天记录中发送者的姓名字段。执行:python main.py upload.json。
步骤 3:导出为 Markdown
{ "type": "export_md", "user_id": "default", "target_id": "Martha" }
执行:python main.py export_md.json,生成 storage/default_Martha/chat.md。
步骤 4:人格分析并生成 profile.md
storage/{user_id}_{target_id}/chat.md(若文件过大请分块处理)。profile.md(此步骤由主 Agent 完成;无独立 API 接口)。必须 将该角色添加至工作区根目录的 USER.md 文件中。
新建(或扩展)一个名为 “Re:Live characters” 的章节,并执行以下操作:
- **Martha**: pharmacy / biology student, gentle and friendly, loves mystery movies- **Dabao**: colloquial, warm and reliable friend who enjoys cooking and traditional activitiesRe:Live digital-clone skill. When the user types relive:, read SKILL.md under .openclawworkspaceskillsrelive for acting rules, and read profile.md under .openclawworkspaceskillsrelivestoragedefault_{target_name} as the persona definition for that character. 主 Agent 将从此处读取 USER.md 中的信息,以获知当前有哪些 Re:Live 角色、如何简要描述它们,以及如何将 relive 命令路由至本技能及其对应的 profile.md。
/relive:(例如 /relive:Martha):进入 Re:Live 模式;主 Agent 将 target_id 存入会话状态;此后发往本技能的所有消息均使用该 ID;回复经 Re:Live 流程生成,并持久化至 storage/{user_id}_{target_id}/ 下。/relive:end:退出 Re:Live 模式并清除当前角色状态。只要当前存在活跃的 Re:Live 角色,标准流程即为:读取 profile → 按需调用 get_context → LLM 生成 → synthesize → 持久化。
每次与该角色开始对话前,必须读取 storage/{user_id}_{target_id}/profile.md 并将其注入主 Agent 的系统提示 / 上下文,确保回复风格一致。
针对每条用户消息,在技能根目录下执行:
get_context.json(content = 用户消息),运行 python main.py get_context.json,将返回的上下文用于辅助生成。synthesize.json(content = 回复文本,user_message = 用户消息,output_mode = text/voice/video),运行 python main.py synthesize.json。即使仅需文本输出,若希望该轮对话被纳入运行时缓存与 RAG 索引,也应调用 synthesize(此时 output_mode 可设为 text 或省略)。output_mode: "video"。收到 video_task_id 后,运行自动生成的 video_wait.json 进行轮询并下载最终视频。| type | 说明 | 必需参数 |
|---|---|---|
init |
初始化存储目录 | user_id, target_id |
upload |
上传聊天记录 | user_id, target_id, file_path, file_type, self_name, target_name |
export_md |
将聊天记录导出为 Markdown | user_id, target_id |
get_context |
获取对话上下文(含 RAG 检索) | user_id, target_id, content |
synthesize |
生成回复并持久化(根据 output_mode 输出 text/voice/video) |
user_id, target_id, content, user_message |
video_generation_wait |
轮询视频任务状态并下载至 character cache/ 目录 | user_id, target_id, task_id |
self_name / target_name 必须与聊天记录中发送者姓名字段 完全一致。output_mode 可选值为 text(默认)、voice、video;reference_image_url 为可选字段(若未传入,则自动从角色目录下的 reference_image_url.txt 读取);video_wait: true 为可选字段,启用后将在调用内持续轮询直至视频生成完成。视频成功生成后,将自动生成 video_wait.json;执行 python main.py video_wait.json 即可完成轮询与下载。type 字段必须为 video_generation_wait;约定俗成的文件名为 video_wait.json。可选参数包括 poll_interval_seconds 和 poll_timeout_seconds。注意(OpenClaw exec 超时限制):当本技能通过 OpenClaw 的
exec调用时,较长的 CosyVoice3 语音合成任务可能因默认执行超时而被强制终止。若观察到进程在日志输出synthesis text ...后立即以退出码 1 结束,且 未生成任何音频文件,请检查npm/node_modules/openclaw/dist/auth-profiles-*.js文件,并增大DEFAULT_EXEC_TIMEOUT_MS的值(例如从5e3改为180e3),以保障长耗时语音合成任务顺利完成。
相关专题
热门下载
相关下载
精品课程
共6课时 | 54.7万人学习
共89课时 | 134.1万人学习
共49课时 | 82.6万人学习
最新文章