SmolAgents' CodeAgent
incorrectly processes input before invoking tools, leading to truncation of long text even when a tool is explicitly designed to handle it. This defeats the purpose of tools and prevents reliable execution in workflows requiring large text processing.
- Define a Tool (e.g.,
SummarizationTool
) that accepts long text and chunks it internally. - Register the Tool with
CodeAgent
. - Send a large text input via
agent.run(prompt)
. - Observe the Issue: