Commit 920fff5a authored by Your Name's avatar Your Name

Implement Phase 2 Claude provider improvements

Add three key improvements to ClaudeProviderHandler:

1. Thinking Block Support (Phase 2.1):
   - Extract thinking/reasoning content from Claude API responses
   - Handle both 'thinking' and 'redacted_thinking' block types
   - Store thinking content in provider_options for downstream access
   - Reference: vendors/kilocode thinking support via AI SDK

2. Tool Call Streaming (Phase 2.2):
   - Parse content_block_start events for tool_use blocks
   - Stream tool call arguments via input_json_delta events
   - Emit tool calls in OpenAI streaming format on content_block_stop
   - Reference: fine-grained-tool-streaming-2025-05-14 beta feature

3. Detailed Usage Metadata (Phase 2.3):
   - Extract cache_read_input_tokens from API response
   - Extract cache_creation_input_tokens from API response
   - Add prompt_tokens_details and completion_tokens_details to usage
   - Log cache usage for analytics
   - Reference: vendors/kilocode session/index.ts usage extraction

All methods integrated into _convert_to_openai_format() and
_handle_streaming_request() for automatic application.
parent cc941d28
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment