Skip to content

[Feature] Merge similar tool parameters and functions to reduce injection length and mitigate LLM hallucinations / 合并相似工具的参数与功能,缩短工具注入长度,降低模型幻觉 #119

@SunYanbox

Description

@SunYanbox

Context / 背景
Currently, tools like read_lines and read are separate, each with distinct parameters and descriptions. This increases the total token length of tool injection and may confuse the model into picking the wrong tool or misusing parameters.
目前像 read_linesread 这类工具相互独立,各自带有不同的参数与描述,导致工具注入的整体 token 长度增加,且可能让模型困惑,从而选错工具或用错参数。

Proposed behavior / 期望行为
Merge read_lines into read, supporting optional line range parameters. Other similar tool pairs (e.g., write_append into write) should follow the same strategy to reduce interface surface and prevent hallucinated calls.
read_lines 合并到 read,通过可选的行范围参数支持原功能。其他类似的工具对(例如 write_append 合并到 write)也遵循相同策略,以减少接口数量,避免模型幻觉调用。

Benefit / 收益
Shorter prompt injection → faster inference, lower cost. Fewer tool options and clearer parameter rules → lower hallucination rate.
更短的工具注入文本 → 推理更快、成本更低;更少的工具选项与更清晰的参数规则 → 模型幻觉率下降。

未完全确定完整计划 / Plan not fully finalized

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions