Set up a metric
- Manual
- Automatic
- Library
- API
- Bluejay as Code
1
Open the form
On the Metrics page, click Create, then Create manually.



2
Write the rule
Choose a metric type. For LLM as a Judge, pick the response type and write the prompt with the prompting guide.



3
Choose where it runs
Select the agents to grade. Runs on decides whether the metric grades simulations, production conversations, or both. To grade only some conversations, add metric conditions. Then click Create.
4
Run it in simulations
New simulations run all of their agent’s metrics. For an existing simulation, turn the metric on in the simulation’s Custom Metrics tab.
Metric types
Add metric conditions
Use a conditional metric when a rule applies only to some conversations. On other conversations, the metric does not run and has no result. Common use cases include:- Check the refund policy wording only when the agent called the refund tool.
- Check that the agent stated the copay only when the conversation reached the billing step of the workflow.
- Check how the agent handled the escalation only when a Customer Asked for a Human metric returned Yes.
- The conversation reached a node of the agent workflow. You pick the node from the workflow, so the metric must grade one agent. In YAML, find node IDs with Get Workflow Summary.
- The agent called a given tool.
- Another metric has a given result, for example Fail.
Tool calls, events, and metadata
If a metric grades something the transcript does not show, such as which tools your agent called, send that data to Bluejay after each simulated call. Check your connection’s integration page first, because some integrations send tool calls for you. You can send:- Tool calls: the tools your agent called, with their inputs and outputs. A Tool Call metric needs them.
- Traces: the IDs of the OpenTelemetry traces your agent exported during the call, sent as
trace_ids. A Trace metric needs them, and every metric sees a summary of the linked trace. See Traces. - Events: moments in the conversation, such as an escalation or a hold.
- Metadata: a JSON object about the whole conversation, such as the customer’s name. Each key fills a dynamic variable in a metric prompt.
Send tool calls
1
Read the result ID
Bluejay sends an
X-Simulation-Result-Id with each simulated call, and the integration page for your connection says where it arrives. Have your agent read it.If your agent cannot read the ID, leave out simulation_result_id and send start_time, end_time, and duration, so Bluejay can find the call.2
Record the data
During the call, have your agent record its tool calls, and any events and metadata you want to grade.
3
Send it after the call
After the call ends, send the data to
POST /v1/update-simulation-result:


