Skip to content

v0.2.29

Latest

Choose a tag to compare

@DEENUU1 DEENUU1 released this 22 Aug 10:22
8ac7b67

A tool's return description now reaches the model the way pydantic-ai sends every other one.

render appended a prose Returns: … paragraph. The framework wraps a docstring's Returns: section in <summary> and <returns> tags instead — so a host registering these tools beside tools of its own ended up with two conventions in one tool list: one built from a docstring arriving as XML, and ls arriving as prose describing the same kind of thing.

<summary>List the files and directories at a path, with their sizes.

Use it to see what one directory holds. To find files by name or extension anywhere below it, use `glob`…</summary>
<returns>
<description>One line per entry, directories marked with a trailing `/`…</description>
</returns>

The test pins the shape against a tool pydantic-ai renders itself rather than against a string literal, so a change on that side fails here rather than leaving these tools quietly speaking the old dialect. A ToolText with no returns is still plain prose, which is what the framework does with a docstring that has no Returns: section.

The *_DESCRIPTION constants carry the new shape with them. A catalogue that wants a sentence for a person reads ToolText.summary.

Full detail in CHANGELOG.md.