• Stefy Lanza (nextime / spora )'s avatar
    Add comprehensive tool calls support for Google and Anthropic providers · 60ca20d2
    Stefy Lanza (nextime / spora ) authored
    GoogleProviderHandler enhancements:
    - Process all parts in response content (not just first part)
    - Extract and combine all text parts
    - Detect and convert Google function_call to OpenAI tool_calls format
    - Generate unique call IDs for tool calls
    - Handle function responses for debugging
    - Set content to None when tool_calls are present (OpenAI convention)
    - Add comprehensive logging for tool call detection and conversion
    - Support both text and function/tool calls in same response
    - Validate response against ChatCompletionResponse Pydantic model
    - Add detailed response structure logging
    
    AnthropicProviderHandler enhancements:
    - Process all content blocks (not just text)
    - Detect and convert Anthropic tool_use blocks to OpenAI tool_calls format
    - Generate unique call IDs for tool calls
    - Combine all text parts from multiple blocks
    - Set content to None when tool_calls are present (OpenAI convention)
    - Add comprehensive logging for tool_use detection and conversion
    - Validate response against ChatCompletionResponse Pydantic model
    - Add detailed response structure logging
    
    Both handlers now properly translate provider-specific function calling
    formats to OpenAI-compatible tool_calls structure, ensuring clients receive
    valid structured responses with proper schema validation.
    60ca20d2
Name
Last commit
Last update
..
__init__.py Loading commit data...
config.py Loading commit data...
handlers.py Loading commit data...
models.py Loading commit data...
providers.py Loading commit data...