Commits
Click on a commit to change the comparison rangefeat(anthropic): add include_response_headers parameter to ChatAnthropic
This change adds support for include_response_headers parameter to ChatAnthropic,
providing feature parity with ChatOpenAI. When set to True, HTTP response headers
are included in the response_metadata of AI messages.
- Add include_response_headers parameter to ChatAnthropic class
- Implement _create_with_raw_response and _acreate_with_raw_response methods
- Update _generate, _agenerate, _stream, and _astream methods to handle headers
- Modify _format_output to conditionally include headers in response_metadata
- Add comprehensive unit and integration tests
- Maintain backward compatibility by only setting headers when present
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>12 days ago
by ketanbhatt