Skip to content

docs(character): 更新默认预设与工具调用说明#24

Merged
CookSleep merged 1 commit intoChatLunaLab:mainfrom
CookSleep:docs/character-tool-call-preset-20260405
Apr 5, 2026
Merged

docs(character): 更新默认预设与工具调用说明#24
CookSleep merged 1 commit intoChatLunaLab:mainfrom
CookSleep:docs/character-tool-call-preset-20260405

Conversation

@CookSleep
Copy link
Copy Markdown
Member

@CookSleep CookSleep commented Apr 5, 2026

Summary

  • 同步 chatluna-character 当前默认预设模板,补齐新版 next_reply、多媒体消息格式和相关注释说明。
  • 新增实验性工具调用默认预设文档资源,并在 Character 文档中补充两种默认预设的区别与适用场景。
  • 更新 Character 文档中的工具调用回复说明,补充 experimentalToolCallReply 配置项。

Summary by CodeRabbit

  • New Features

    • Added a tool-calling preset as an alternative to the standard preset
    • Added experimentalToolCallReply configuration option to enable experimental tool-calling reply flow
  • Documentation

    • Updated preset documentation with new next_reply tag-based schema format
    • Clarified preset compatibility and available default preset templates
    • Enhanced message format and media output examples

@CookSleep CookSleep merged commit c5f52c2 into ChatLunaLab:main Apr 5, 2026
1 check was pending
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4af8fe6a-3c54-4493-86cc-8cd54124542c

📥 Commits

Reviewing files that changed from the base of the PR and between 70dc94f and 06c90f5.

📒 Files selected for processing (3)
  • docs/ecosystem/other/character.md
  • docs/public/resources/character_preset.yml
  • docs/public/resources/character_preset_tool_call.yml

📝 Walkthrough

Walkthrough

This PR updates character plugin documentation to introduce a new tool-calling preset variant alongside the existing standard preset. Changes include reorganized message format guidance, revised next_reply configuration schema using tag-based syntax, and a new experimentalToolCallReply configuration option enabling tool-based reply flows.

Changes

Cohort / File(s) Summary
Main Plugin Documentation
docs/ecosystem/other/character.md
Added new "tool-calling" default preset template; clarified that built-in presets are not fully compatible with main plugin presets; expanded message format documentation with standardized XML examples and new tag types (image, video, file, markdown); split input generation format guidance between standard and tool-calling presets; added experimentalToolCallReply configuration option.
Standard Preset Configuration
docs/public/resources/character_preset.yml
Updated XML tools guidance; replaced next_reply configuration from reason-expression syntax to tag-based schema with type, user_id, seconds, max_wait_seconds, and group attributes; removed "禁言" section instructions; updated interaction and media output examples to reflect new <next_reply /> tag format and replaced <sticker> with <image> examples.
Tool-Calling Preset Configuration
docs/public/resources/character_preset_tool_call.yml
New preset configuration file for tool-calling character variant; includes nick_name trigger rules, input templates with long-term memory integration, comprehensive system prompts covering behavior rules and message formatting, default status output structure, and mute keywords configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • dingyi222666

Poem

🐰 A preset splits in two today,
Tool-calling hops into the fray!
Messages dance in tags so bright,
<next_reply> shines in new light ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an experimental 'Tool Call' reply mode and a corresponding preset, while updating the standard preset to use XML-tag-based logic for next_reply and expanding documentation for message tags. Feedback identifies a logical conflict in the next_reply examples where mutually exclusive conditions are combined using AND logic, which should be corrected. Additionally, redundant XML format definitions in the tool-call preset should be removed to prevent model confusion, as these structures are already defined by tool parameters.

Comment on lines +366 to +367
<next_reply group="wait-user" type="message_from_user" user_id="" />
<next_reply group="wait-user" type="no_message_from_user" user_id="all" seconds="60" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

这里的示例使用了相同的 group="wait-user"。根据第 219 行的说明,“相同 group 按 AND 组合”,这意味着触发条件必须同时满足“收到指定用户消息”且“连续 60 秒无人发言”。由于这两个条件在逻辑上很难同时满足(收到消息的瞬间通常不满足“无人发言”条件),这可能导致预设无法按预期触发。如果意图是“收到消息或超时触发(OR 逻辑)”,建议移除 group 属性或使用不同的 group 名称。

      <next_reply type="message_from_user" user_id="" />
      <next_reply type="no_message_from_user" user_id="all" seconds="60" />

Comment on lines +248 to +276
# <status></status>格式
- 模板:
<status>
心情:"开心"
状态:"正在闲聊"
记忆:""
动作:"拿起手机聊天"
</status>
- 内容解释:
- 心情:如平静、愉悦、烦恼等,影响回复的情感倾向
- 状态:当前的具体情况描述
- 记忆:关于最近几个小时聊天记录的简要记录,每次回复时叠加之前的记忆,用于替代工具中的短期记忆,中、长期记忆请使用工具。不超过120字,如果超过120字,请裁剪掉之前一部分旧的无关紧要的内容
- 动作:当前正在进行的活动
- 注意:根据这些因素调整回复的语气和内容,保持角色的一致性和真实感,使用中文

# <think></think>格式
示例:
- 1:
<think>
……
</think>
- 2:
<think>
……
</think>
- 3:
<think>
……
</think>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

在工具调用预设中,模型应当通过 character_reply 工具的参数来输出状态(status)和思考过程(think)。根据 character.md 中的说明,工具调用预设的参数说明已经涵盖了这些格式要求,因此无需在 system 提示词中手动补充 XML 格式定义。保留这些定义可能会误导模型尝试输出 XML 文本块而非执行工具调用,建议移除这些冗余的格式说明部分。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant