fix: unify func_call XML tag format to use name attribute#103
Merged
SunYanbox merged 4 commits intoMay 2, 2026
Conversation
docs(README): 添加中文文档并完成英文文档重构 (SunYanbox#51)
docs(contributing): 新增中英文双语贡献指南
Closes SunYanbox#99 Migrate from <func_call><func_name>...</func_name> to <func_call name="..."> format across prompts, tool generation, help text, and input parser. The name-attribute format is more concise and reduces model hallucination risk by simplifying the XML schema. Note: Tests require Python 3.14+ (textual dependency) and cannot be run locally in this session. The change is verified by syntax check and manual review of all affected files.
Owner
|
Thanks for your contribution! I've changed the base to 感谢你的贡献!我将目标分支改为了 |
This was referenced May 3, 2026
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.
Summary
Migrate the tool call XML tag format from the old nested
<func_name>style to themore concise
<func_call name="...">attribute style.Old format:
New format:
This change affects 4 files:
src/constants/prompts.py— Updated system prompt examplessrc/workspace/tools/base_tool.py— Updatedto_func_call()outputsrc/core/input_parser.py— Removed deprecation warning for the new format (it's now standard)src/utils/generate_help_text.py— Updated help text exampleThe new format is more concise, reduces token count in LLM prompts, and lowers model
hallucination risk by simplifying the XML schema.
Related
Closes #99
Tests
Tests require Python 3.14+ (project dependency:
textual) and cannot be run locally.The change is verified by syntax check (
py_compile) and manual review of allaffected files. CI should validate test compatibility.