anthropics / anthropic-quickstarts

A collection of projects designed to help developers quickly get started with building deployable applications using the Anthropic API
MIT License
6.55k stars 904 forks source link

Parameter `old_str` is required for command: `str_replace` #127

Open p-i- opened 1 week ago

p-i- commented 1 week ago
Tool Use: str_replace_editor
Input: {'command': 'str_replace', 'path': '/host/master_state.md', 'old_str': '', 'new_str': '...blablabla...'}

Parameter old_str is required for command: str_replace

I encounter this error frequently. The problem is if the AI gets the error, it doesn't subsequently use the tool correctly, it tries a different approach.

Tool Use: bash
Input: {'command': "cat > /host/master_state.md << 'EOL'...blablabla...EOL"}

And this times out, which is a SECOND problem.

So it has to try a THIRD approach.

Are you failing to make a distinction between '' and None ?