基本信息

来源摘要/节选

公开展示已截断至最多 800 个字符;请访问原始来源查看完整上下文。

工具文档是写给 LLM 的,不是写给人的 你有没有写过这样的工具文档: @lc_tool def get_data ( query: str ) -> str : “““Get data.””” … 这对人类来说是糟糕的文档,对 LLM 来说更糟——它不知道这个工具做什么、什么时候调它、传什么参数。 工具设计有三条核心维度: 描述质量(LLM 选不选你)、错误处理(出错时崩不崩)、粒度设计(参数好不好提取) 。本文用实验数据说话。 Demo 1:描述质量——真正影响工具选择的条件 对比同一个天气工具的两个版本:

版本 A:模糊

@lc_tool def weather_vague ( city: str ) -> str : “““Get data.””” …

版本 B:精准

@lc_tool def weather_precise ( city: str ) -> str : “““Get current weather for a city.

Returns temperature \(Celsius\) and condition \(sunny / cloudy / rainy / unknown\).
Use this whenever the user asks about weather, temperature, or sky conditions
for a specific city. Pass the city name as a plain string, e.g.…

来源说明

当前只保存了公开页面节选,不代表原文全文。请以原始来源为准。

本页只呈现已做哈希绑定的来源证据,不包含基于旧正文或缺失原文的扩展推断。