mirror of
https://github.com/trycua/computer.git
synced 2026-01-01 11:00:31 -06:00
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.