Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification around tool_result blocks after tool_use #653

Open
joshling1919 opened this issue Jan 12, 2025 · 0 comments
Open

Clarification around tool_result blocks after tool_use #653

joshling1919 opened this issue Jan 12, 2025 · 0 comments

Comments

@joshling1919
Copy link

The documentation for handling tool use and tool results (https://docs.anthropic.com/en/docs/build-with-claude/tool-use#handling-tool-use-and-tool-result-content-blocks) suggests that sending tool results is optional:

[optional] Continue the conversation by sending a new message with the role of user, and a content block containing the tool_result type...

However, in practice, attempting to continue the conversation with a user message after a tool_use response without first providing the corresponding tool_result block results in an error:

Did not find 1 tool_result block(s) at the beginning of this message. Messages following tool_use blocks must begin with a matching number of tool_result blocks.

To clarify, are tool_results not actually optional? How should we think about the role of tool_result in the cases where we are using tool_use mainly to get structured outputs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant