Skip to content

fix: unify func_call XML tag format to use name attribute#103

Merged
SunYanbox merged 4 commits into
SunYanbox:developfrom
blut-agent:fix/unify-func-call-format
May 2, 2026
Merged

fix: unify func_call XML tag format to use name attribute#103
SunYanbox merged 4 commits into
SunYanbox:developfrom
blut-agent:fix/unify-func-call-format

Conversation

@blut-agent
Copy link
Copy Markdown
Contributor

Summary

Migrate the tool call XML tag format from the old nested <func_name> style to the
more concise <func_call name="..."> attribute style.

Old format:

<func_call>
    <func_name>tool_name</func_name>
    <param name="x">value</param>
</func_call>

New format:

<func_call name="tool_name">
    <param name="x">value</param>
</func_call>

This change affects 4 files:

  • src/constants/prompts.py — Updated system prompt examples
  • src/workspace/tools/base_tool.py — Updated to_func_call() output
  • src/core/input_parser.py — Removed deprecation warning for the new format (it's now standard)
  • src/utils/generate_help_text.py — Updated help text example

The 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 all
affected files. CI should validate test compatibility.

SunYanbox and others added 4 commits April 30, 2026 13:37
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.
@SunYanbox SunYanbox changed the base branch from main to develop May 2, 2026 23:56
@SunYanbox SunYanbox added the bug Something isn't working label May 2, 2026
@SunYanbox
Copy link
Copy Markdown
Owner

Thanks for your contribution! I've changed the base to develop, looks good. Merging now.

感谢你的贡献!我将目标分支改为了 develop,没有问题,现在合并。

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 统一工具调用标签格式以降低模型幻觉 / Unify Tool Call Tag Format to Reduce Model Hallucination

2 participants