Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,9 @@ navigation:
- page: Configure an AI tester
path: observability/simulations-configure-ai-tester.mdx
icon: fa-light fa-robot
- page: Recording replay
path: observability/simulations-recording-replay.mdx
icon: fa-light fa-waveform-lines
- page: Manage
path: observability/simulations-manage.mdx
icon: fa-light fa-sliders
Expand Down
6 changes: 3 additions & 3 deletions fern/observability/simulations-advanced.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Open a suite and select **Edit**, then **Next**. The review step contains the **

## Mock tool responses

During a simulation, the [**assistant**](/assistants/quickstart) or [**squad**](/squads) under test runs its real [**tools**](/tools). Mock a tool to return fixed text instead, so that tool never calls its live service or API. A mock intercepts only the tool it names; every other tool the assistant or squad calls still runs for real.
During a simulation, the [**assistant**](/assistants/quickstart) or [**squad**](/squads) under test runs its real [**tools**](/tools). Mock a tool to return fixed text instead, so that tool never calls its live service or API. A mock intercepts only the tool it names; every other tool the assistant or squad calls still runs for real. During a [recording replay](/observability/simulations-recording-replay#tools-and-handoffs-during-a-replay), no tool runs: every tool call returns a fixed result, and a scenario mock still returns its own result for the tool it names.

<Note>
Suites that [Composer generates](/composer#generate-tests-for-an-assistant) come with mocks already set. Every tool in the assistant's tool list that would reach an external system is mocked, including handoffs and transfers that can't run safely. Tools that only end or route the conversation run normally, such as end call, voicemail, DTMF, and static handoffs.
Expand Down Expand Up @@ -255,7 +255,7 @@ Both chat and voice payloads include `simulationId`, `runId`, `simulationRunItem

## Reuse structured outputs

Each evaluation references a [**structured output**](/assistants/structured-outputs-quickstart). Reuse a structured output when several simulations should apply the same evaluation criterion. For more patterns, see [**structured output examples**](/assistants/structured-outputs-examples).
Each evaluation on a conversation scenario references a [**structured output**](/assistants/structured-outputs-quickstart). A [recording replay](/observability/simulations-recording-replay) scenario uses the built-in `wer` metric instead. Reuse a structured output when several simulations should apply the same evaluation criterion. For more patterns, see [**structured output examples**](/assistants/structured-outputs-examples).

<Tabs>
<Tab title="Dashboard">
Expand Down Expand Up @@ -285,7 +285,7 @@ curl -X PATCH "https://api.vapi.ai/eval/simulation/scenario/<scenario-id>" \

A latency limit fails a voice simulation when the [**assistant**](/assistants/quickstart) or [**squad**](/squads) under test responds too slowly. Vapi measures latency on each turn of the call, combines the turns into one number, and passes the limit when that number is at or below the limit you set.

Latency limits work alongside structured-output evaluations. A scenario still needs at least one evaluation, and a required limit that fails marks the simulation as failed even when every evaluation passes.
Latency limits work alongside structured-output evaluations. A conversation scenario still needs at least one evaluation, and a required limit that fails marks the simulation as failed even when every evaluation passes. A [recording replay](/observability/simulations-recording-replay) scenario can't have latency limits.

<Tabs>
<Tab title="Dashboard">
Expand Down
6 changes: 5 additions & 1 deletion fern/observability/simulations-manage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ curl -X PATCH "https://api.vapi.ai/eval/simulation/personality/<personality-id>"

Open **Simulations**, then select **Runs** to see every run with its suite, iterations, [**assistant**](/assistants/quickstart) or [**squad**](/squads), run date, and overall result (`Passed` or a failed count such as `1/1 failed`). Filter by **time range**, **status**, or **assistant or squad** to find a run.

Open a run to see whether each simulation passed or failed, its evaluations, its latency results for voice runs, and its transcript. Open an active run to watch the transcript and evaluations update. If a run or iteration can't complete, it shows a **Failure reason** describing what went wrong, such as no payment method on file. See the [**Simulations quickstart**](/observability/simulations-quickstart) for the full walkthrough.
Open a run to see whether each simulation passed or failed, its evaluations, its latency results for voice runs, and its transcript. Open an active run to watch the transcript and evaluations update. If a run or iteration can't complete, it shows a **Failure reason** describing what went wrong, such as no payment method on file. A [recording replay](/observability/simulations-recording-replay) shows its word error rate, WER thresholds, and key-value verdicts in place of evaluations. See the [**Simulations quickstart**](/observability/simulations-quickstart) for the full walkthrough.

</Tab>
<Tab title="cURL">
Expand All @@ -92,6 +92,8 @@ curl -X GET "https://api.vapi.ai/eval/simulation/run/<run-id>" \

The run includes `status` and `itemCounts` (`total`, `passed`, `failed`, and so on). Fetch the result for each simulation iteration with `GET /eval/simulation/run/<run-id>/item`. Each item's `results` holds its `evaluations` and, when the scenario sets latency limits, its `latencyEvaluations`. See [**Review latency results**](/observability/simulations-advanced#review-latency-results).

A recording replay item holds its score in `results.transcriptEvaluation` instead, and its `results.evaluations` is empty. See [**Read the results**](/observability/simulations-recording-replay#read-the-results).

Filter the lists with query parameters:

| Endpoint | Filters |
Expand Down Expand Up @@ -132,6 +134,8 @@ Runs use the assistant's published version. If you're editing a draft, publish y

## Rerun a suite

A suite that contains [recording replay](/observability/simulations-recording-replay) scenarios runs only in voice mode and only against assistants, not squads.

<Tabs>
<Tab title="Dashboard">

Expand Down
10 changes: 9 additions & 1 deletion fern/observability/simulations-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you're planning or running tests with an AI coding assistant, the [simulation
| -- | -- |
| **Simulation suite** | A simulation suite groups one or more simulations that you can run against one or more [**assistants**](/assistants/quickstart) or [**squads**](/squads). |
| **Simulation** | A simulation pairs a scenario with a personality to test one situation. |
| **Scenario** | A scenario defines the AI tester's intent and the success criteria that determine the result: structured-output evaluations and, for voice runs, any latency limits. |
| **Scenario** | A scenario defines what a simulation tests and the success criteria that determine the result. A conversation scenario gives the AI tester its intent and is scored by structured-output evaluations and, for voice runs, any latency limits. A [recording replay](/observability/simulations-recording-replay) scenario plays one of your call recordings to the assistant instead and scores its transcriber against an answer key. |
| **Personality** | A personality defines how the AI tester behaves, including its model, transcriber, and voice. |
| **AI tester** | An AI tester drives the simulated conversation according to a scenario and personality. |

Expand Down Expand Up @@ -58,6 +58,10 @@ directly instead of synthesized speech and transcription.

When you run the suite, Vapi runs each simulation for the number of iterations you select. During each iteration, the AI tester holds a live conversation with the assistant or squad. Vapi then evaluates each conversation with [**structured outputs**](/assistants/structured-outputs-quickstart), checks any [**latency limits**](/observability/simulations-advanced#set-latency-limits) on voice runs, and reports which criteria passed or failed.

### Recording replay scenarios

A [**recording replay**](/observability/simulations-recording-replay) scenario tests the assistant's transcriber instead of the conversation. It plays one of your call recordings to the assistant in a voice call, in place of an AI tester, and scores the transcript against an answer key you provide: word error rate, and whether each key value, such as a name or a medication dose, came through exactly. Use it to compare transcribers on real audio. Conversation scenarios use synthetic speech, so they can't tell you how a transcriber handles your callers.

## When to use Simulations

Use **Simulations** to confirm that an [**assistant**](/assistants/quickstart) or [**squad**](/squads) behaves correctly before or after a change reaches production:
Expand All @@ -67,6 +71,7 @@ Use **Simulations** to confirm that an [**assistant**](/assistants/quickstart) o
- **Edge cases and difficult behavior**: Give the AI tester different personalities to see how the assistant or squad handles impatient, confused, or interrupting behavior.
- **Guardrail validation**: Confirm the assistant or squad stays within its boundaries, such as never promising a refund it can't authorize, and keep the results as evidence.
- **Tool-backed outcomes**: Confirm the assistant or squad completes a workflow and handles tool failures gracefully, such as surfacing a booking error instead of falsely confirming it. Use [**Evals**](/test/evals-best-practices) for exact tool and argument checks.
- **Transcriber selection**: Replay your own recordings to an assistant for each candidate transcriber and compare word error rate and key values. See [**Recording replay**](/observability/simulations-recording-replay).

## Simulations compared with Evals

Expand Down Expand Up @@ -103,6 +108,9 @@ tools into one coverage plan.
<Card title="Configure an AI tester" icon="robot" href="/observability/simulations-configure-ai-tester">
Define the AI tester's scenario, behavior, model, transcriber, and voice.
</Card>
<Card title="Recording replay" icon="waveform-lines" href="/observability/simulations-recording-replay">
Test an assistant's transcriber on your own call recordings.
</Card>
<Card title="Evals quickstart" icon="clipboard-check" href="/observability/evals-quickstart">
Test assistant or squad logic with scripted mock conversations.
</Card>
Expand Down
Loading
Loading