Span-level variables
Available in any scorer with Scope: Span. Each matching span is scored independently.
Example prompt:
Trace-level variables
Available in scorers with Scope: Trace. The scorer runs once per trace and has access to the full conversation thread. The four span-level variables (input, output, expected, metadata) are also available here and are populated from the root span of the trace.
{{thread}}
{{thread}} renders the entire conversation as formatted text, ready to pass directly to a judge model. It’s the simplest way to give the scorer full conversation context.
Example prompt:
{{thread_with_system}}
For scorers, {{thread}} excludes system messages so the judge rubric isn’t polluted by your application’s system prompt. Use {{thread_with_system}} to render the full conversation including system messages, ready to pass directly to a judge model.
For non-scorer prompts, {{thread}} and {{thread_with_system}} are equivalent because both include system messages.
{{human_ai_pairs}}
For Nunjucks prompts, {{human_ai_pairs}} lets you iterate over matched turn pairs:
{{user_messages}} and {{assistant_messages}}
These filter the thread to a single role. Useful if you only need one side of the conversation:
SDK requirements for trace-level scoring
Trace-level scorers require:- TypeScript SDK v2.2.1+
- Python SDK v0.5.6+
- Java SDK v0.3.8+
- Ruby SDK v0.2.1+
- C# SDK v0.2.3+
Setting up multi-turn conversation scoring
If your application creates a new trace per turn (common for chatbots), the easiest way to make{{thread}} work is to route all turns under a single root span using span.export():
Python:
{{thread}} in the prompt will receive the full conversation.