Rodrigo Girão Serrão: Write a ... Note

Rodrigo Girão Serrão: Write a coding agent from first principles: better tools

This tutorial focuses on enhancing a previously built coding agent by integrating Anthropic's provided tools. The goal is to improve the agent's performance by leveraging pre-defined, optimized tool schemas. Specifically, it introduces the "text_editor_20250728" tool, named "str_replace_based_edit_tool," which consolidates the functionalities of reading, writing, replacing, and inserting text. This new tool replaces previously custom-built functions for file manipulation.The tutorial also highlights the "bash" tool, which offers a persistent bash session for executing commands. By using Anthropic's tools, the agent can make more consistent and effective tool calls because the models are trained on these specific schemas. The text editor tool is a versatile command-driven interface, allowing actions like viewing, replacing, creating, or inserting text based on a "command" key within the tool use request. To organize these tools, they will be placed in separate submodules. The existing custom file editing functions and their corresponding dictionary entries will be removed and replaced with the configuration for the Anthropic text editor tool. The text editor tool's "command" key is crucial for disambiguating the desired editing operation.
CdXz5zHNQW_J4wjjDmtWx.webp