Avatar for the langchain-ai user
langchain-ai
langchain
Instrumentation
Wall Time
BlogDocsChangelog

anthropic: add include_response_headers parameter to ChatAnthropic

#31579
Comparing
ketanbhatt:feature/anthropic-include-response-headers
(
1dbb372
) with
master
(
446a9d5
)
CodSpeed Performance Gauge
0%
Improvements
0
Regressions
0
Untouched
13
New
0
Dropped
0
Ignored
0

Benchmarks

Passed

test_stream_time
libs/partners/openai/tests/integration_tests/chat_models/test_base_standard.py::TestOpenAIStandard::test_stream_time
CodSpeed Performance Gauge
+1%
1.1 s
1.1 s
test_stream_time
libs/partners/openai/tests/integration_tests/chat_models/test_responses_standard.py::TestOpenAIStandard::test_stream_time
CodSpeed Performance Gauge
+1%
1.1 s
1.1 s
test_stream_time
libs/partners/openai/tests/integration_tests/chat_models/test_responses_standard.py::TestOpenAIResponses::test_stream_time
CodSpeed Performance Gauge
0%
491.9 ms
490.1 ms
test_init_time
libs/partners/openai/tests/unit_tests/chat_models/test_base_standard.py::TestOpenAIStandard::test_init_time
CodSpeed Performance Gauge
0%
16.7 ms
16.7 ms
test_init_time
libs/partners/openai/tests/unit_tests/chat_models/test_responses_standard.py::TestOpenAIResponses::test_init_time
CodSpeed Performance Gauge
0%
16.8 ms
16.8 ms
test_init_time
libs/partners/mistralai/tests/unit_tests/test_standard.py::TestMistralStandard::test_init_time
CodSpeed Performance Gauge
0%
12.9 ms
12.9 ms
test_stream_time
libs/partners/anthropic/tests/integration_tests/test_standard.py::TestAnthropicStandard::test_stream_time
CodSpeed Performance Gauge
0%
15.9 ms
15.9 ms
test_init_time
libs/partners/deepseek/tests/unit_tests/test_chat_models.py::TestChatDeepSeekUnit::test_init_time
CodSpeed Performance Gauge
0%
1.6 s
1.6 s
test_init_time
libs/partners/groq/tests/unit_tests/test_standard.py::TestGroqStandard::test_init_time
CodSpeed Performance Gauge
0%
1.6 s
1.6 s
test_init_time
libs/partners/fireworks/tests/unit_tests/test_standard.py::TestFireworksStandard::test_init_time
CodSpeed Performance Gauge
0%
6.6 s
6.6 s
test_init_time
libs/partners/openai/tests/unit_tests/chat_models/test_azure_standard.py::TestOpenAIStandard::test_init_time
CodSpeed Performance Gauge
0%
1.7 s
1.7 s
test_init_time
libs/partners/xai/tests/unit_tests/test_chat_models_standard.py::TestXAIStandard::test_init_time
CodSpeed Performance Gauge
0%
3.3 s
3.3 s
test_init_time
libs/partners/anthropic/tests/unit_tests/test_standard.py::TestAnthropicStandard::test_init_time
CodSpeed Performance Gauge
0%
3.8 ms
3.8 ms

Commits

Click on a commit to change the comparison range
Base
master
446a9d5
0%
feat(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>
1dbb372
12 days ago
by ketanbhatt
© 2025 CodSpeed Technology
Home Terms Privacy Docs