feat: add context_limiter_c and debug_msg_dump toolpkg examples#466
Merged
AAswordman merged 6 commits intoAAswordman:mainfrom Apr 17, 2026
Merged
feat: add context_limiter_c and debug_msg_dump toolpkg examples#466AAswordman merged 6 commits intoAAswordman:mainfrom
AAswordman merged 6 commits intoAAswordman:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
添加两个 ToolPkg 示例插件
本 PR 向
examples/目录添加了两个 ToolPkg 格式的沙盒包示例:1.
context_limiter_c/— 楼层限制器 C截取最近 N 层上下文,保留 SYSTEM 消息 + 最近 N 层 USER/ASSISTANT 消息。
功能特点:
PromptFinalizeHook在发送给模型前裁剪上下文InputMenuTogglePlugin在聊天输入栏提供开关和楼层数调节set_floor_limit/get_floor_limit工具,AI 也可以动态调节文件结构:
2.
debug_msg_dump/— 消息调试转储将每次发送给模型的完整消息列表(包括 System Prompt、Tool Prompt、所有历史消息)保存到文件,用于调试。
功能特点:
PromptHistoryHook和PromptFinalizeHook在两个阶段分别转储/sdcard/Download/Operit/debug_msg_dump/dumps/dump_current_chat工具,可手动触发当前对话的消息转储文件结构:
这两个插件展示了 ToolPkg 的多种高级特性:
registerPromptFinalizeHook/registerPromptHistoryHook(Prompt Hook)registerInputMenuTogglePlugin(输入栏菜单插件)