Skip to main content
Install:

Usage

Returning metadata: {"model": msg.model} records which model produced each response on the result row, visible in the run’s results and metadata.

With tracing

Combine this with patch_anthropic_client to get a full Execution Timeline per result, not just a score. Wrap the patched call in tracer.trace(..., sync=True) so span.trace_id is populated before your function returns. The patch attaches to that span instead of sending its own independent trace, so you still get exactly one trace per case. Inside .execute(), traces are automatically stamped monitor=False (and source="eval-run"), so no flag is needed:
patch_anthropic_client on its own (no surrounding span) is fire-and-forget and never returns a trace_id; see Decorator vs. context manager. Wrapping it in tracer.trace(..., sync=True), as shown above, is what makes the id available.
A complete working example is available as anthropic_eval.py in the AgentX-Python repository.