diff --git a/py/src/braintrust/integrations/anthropic/test_anthropic.py b/py/src/braintrust/integrations/anthropic/test_anthropic.py index 588a5c5e..5fbbeac3 100644 --- a/py/src/braintrust/integrations/anthropic/test_anthropic.py +++ b/py/src/braintrust/integrations/anthropic/test_anthropic.py @@ -304,6 +304,7 @@ def test_anthropic_beta_messages_create_captures_context_and_usage_metadata(memo span = find_span_by_name(memory_logger.pop(), "anthropic.messages.create") assert "error" not in span assert span["metadata"]["context_management"] == {"edits": [{"type": "clear_thinking_20251015", "keep": "all"}]} + assert span["metadata"]["speed"] == "standard" assert span["metadata"]["usage_speed"] == response.usage.speed == "standard" diff --git a/py/src/braintrust/integrations/anthropic/tracing.py b/py/src/braintrust/integrations/anthropic/tracing.py index 27ea2220..6aa0a29f 100644 --- a/py/src/braintrust/integrations/anthropic/tracing.py +++ b/py/src/braintrust/integrations/anthropic/tracing.py @@ -67,6 +67,7 @@ def _accumulate_event_parameters(accumulator) -> set[str]: "model", "max_tokens", "temperature", + "speed", "top_k", "top_p", "stop_sequences",