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

Anthropic tool_choice should be any #1085

Open
2 of 8 tasks
josepablog opened this issue Oct 17, 2024 · 2 comments
Open
2 of 8 tasks

Anthropic tool_choice should be any #1085

josepablog opened this issue Oct 17, 2024 · 2 comments

Comments

@josepablog
Copy link

  • This is actually a bug report.
  • I am not getting good LLM Results
  • I have tried asking for help in the community on discord or discussions and have not received a response.
  • I have tried searching the documentation and have not found an answer.

What Model are you using?

  • gpt-3.5-turbo
  • gpt-4-turbo
  • gpt-4
  • Bedrock Anthropic Claude Sonnet 3.5

Describe the bug

Doesn't seem the tools are being sent to (Bedrock) Anthropic correctly. For instance, if I set set_verbose=True on the README example, I can see that tool_choice is not being sent:

{'model': 
     'claude-3-opus-20240229',
      'messages': [{'role': 'user', 'content': [{'type': 'text', 'text': 'Extract Jason is 25 years old.'}]}],
       'max_tokens': 1024,
       'tools': [{'name': 'User', 'description': 'Correctly extracted `User` with all the required parameters with correct types', 'input_schema': {'properties': {'name': {'title': 'Name', 'type': 'string'}, 'age': {'title': 'Age', 'type': 'integer'}}, 'required': ['age', 'name'], 'type': 'object'}}]}'

Per Anthropic's [documentation](https://docs.anthropic.com/en/docs/build-with-claude/tool-use] the default is:

auto: allows Claude to decide whether to call any provided tools or not. This is the default value.

Without this, in more complicated examples, Claude is not obliged to generate a valid JSON.

@jxnl
Copy link
Collaborator

jxnl commented Oct 18, 2024

would love a pr to fix this

@josepablog
Copy link
Author

josepablog commented Oct 18, 2024 via email

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

2 participants