Get a trial

SDK platic.agents.evals.runs.trial()

Open a trial conversation to understand why it passed or failed. Take launchId, runId and trialId from the launch, and read events in seq order. Events include messages, tool calls and results, agent changes and help requests.

Example

await platic.agents.evals.runs.trial("agent_123", "launch_123", "run_123", "trial_123");

Path parameters

ParameterTypeDescriptionRequired
agentIdstringAgent ID✓
launchIdstringThe launch✓
runIdstringThe run, which must belong to that launch✓
trialIdstringThe trial✓

The three IDs come in Get a launch.

Response

The trial fields, plus events:

{
  "status": "success",
  "data": {
    "runId": "run_a1f3",
    "trialId": "trial_4",
    "scenarioId": "asks_for_person",
    "scenarioVersion": 1,
    "status": "passed",
    "currentTurn": 1,
    "endReason": "assistance_requested",
    "assistanceAvailable": true,
    "note": "Conversation ended (assistance_requested) after 1 turns.",
    "explanation": "All required checks passed.",
    "verdicts": [
      { "check": "assistance_requested:true", "severity": "must", "passed": true, "reason": "The agent asked a person for help.", "eventIds": ["ev_03"] }
    ],
    "events": [
      { "eventId": "ev_01", "seq": 0, "turn": 1, "type": "message", "role": "user", "text": "I need to talk to someone from your team, please" },
      {
        "eventId": "ev_02",
        "seq": 1,
        "turn": 1,
        "type": "tool_call",
        "name": "call_for_help",
        "args": { "query": "Wants to talk to a person", "context": "They asked in their first message." },
        "result": null,
        "error": null,
        "round": 0,
        "callIndex": 0
      },
      {
        "eventId": "ev_03",
        "seq": 2,
        "turn": 1,
        "type": "assistance_request",
        "source": "agent",
        "reason": "Wants to talk to a person. They asked in their first message.",
        "waitingMessage": "I'm connecting you with someone from our team. They'll be with you shortly."
      },
      { "eventId": "ev_04", "seq": 3, "turn": 1, "type": "message", "role": "agent", "text": "I'm connecting you with someone from our team. They'll be with you shortly." }
    ]
  }
}

Response fields

The trial fields are those of Get a launch. Each event in events has eventId, seq, turn and type, plus the fields of its type:

typeFieldsWhat it is
messagerole (user or agent), textA message from the simulated customer or from the agent.
tool_callname, args, result, error, round, callIndexA call to one of the agent's real tools. error has the error if it failed. round is the agent round that made it (several calls can be in the same round) and callIndex its place within that round; null if unknown.
handofffromAgent, toAgent, payloadThe agent handed the conversation to another agent (a subagent), with the data sent in payload.
assistance_requestsource, reason, waitingMessageA request for human assistance. source records the origin: agent, guardrail or subagent. reason is the reason and waitingMessage the waiting message the customer would have received.
state_changekey, old, newA stored value that changed. The agent's real tools do not report it.

Errors

Statusdetails.codeWhen
404AGENT_NOT_FOUNDThe agent does not exist or belongs to another workspace.
404EVAL_NOT_FOUNDThe trial does not exist, the run does not belong to that launch or the launch does not belong to that agent.

Notes

  • Sort events by seq. Each event has a stable eventId: it is the one the verdicts' eventIds cite. Do not interpret its format.
  • Treat any other type as unknown.
  • Read access to the agent is enough.

Assistance requests in the conversation

  • An assistance_request goes after that turn's tools and before that turn's agent message, whose text is the waiting message. If the agent asked for it (source: "agent"), its call_for_help call comes before, with query and context. To know whether help was asked for, read the assistance_request, not the call.
  • With an assistance_request the trial ends (endReason: "assistance_requested"): in evals no real request is created, nobody is notified and there is no person to continue the conversation.