Skip to content

Conversation

@LucaStngn
Copy link

This commit fixes three bugs that prevented custom function tools from working alongside the computer tool with Anthropic Claude models:

  1. Tool format conversion: Convert OpenAI format to Anthropic format
  • Changed from {type, function: {parameters}} to {name, description, input_schema}
  1. Response handling (content format): Add custom tool detection
  • Check tool name and handle custom tools separately from computer actions
  • Prevents 'Unknown action type: None' errors
  1. Response handling (tool_calls format): Add custom tool handling
  • Parse JSON arguments and route custom tools correctly
  • Ensures compatibility with litellm's normalized response format

These changes enable developers to use custom Python functions as tools alongside computer control tools without breaking existing functionality.

Fixes: Custom function tools now work correctly with Anthropic models.

This commit fixes three bugs that prevented custom function tools from working alongside the computer tool with Anthropic Claude models:

1. Tool format conversion: Convert OpenAI format to Anthropic format
- Changed from {type, function: {parameters}} to {name, description, input_schema}

2. Response handling (content format): Add custom tool detection
- Check tool name and handle custom tools separately from computer actions
- Prevents 'Unknown action type: None' errors

3. Response handling (tool_calls format): Add custom tool handling
- Parse JSON arguments and route custom tools correctly
- Ensures compatibility with litellm's normalized response format

These changes enable developers to use custom Python functions as tools alongside computer control tools without breaking existing functionality.

Fixes: Custom function tools now work correctly with Anthropic models.
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

Successfully merging this pull request may close these issues.

1 participant