Skip to content

Documentation / Examples / Minimal offline bot

Minimal offline bot

examples/minimal_offline.py in the source repository is the canonical first-run example.

Why it is deterministic

  • ScriptedAdapter supplies a fixed connection, participant, transcript, tool call, and action-fulfilled result.
  • FakeMonotonicClock advances only when the test asks it to.
  • DeterministicIds supplies repeatable call and evidence identifiers.
  • No network operation or environment credential is used.

Why it terminates

The scripted reasoning operation invokes the consumer's end_call tool. Its handler calls:

await context.request_end(
    EndRequest(EndRequestSource.END_CALL_TOOL, "quickstart_complete")
)

VAANI admits the first request, closes the interaction gate, tears resources down, finalizes evidence, and publishes exactly one result. The script asserts one CLOSED transition and zero adapter resources and clock waiters.

Use it as a test template

Copy the file into a consumer test and change:

  • the prompt;
  • profile identities;
  • tools and consumer state;
  • scripted participant turns and provider outputs;
  • result assertions that represent your business contract.

Keep the provider declaration consistent with the profiles under test. For live validation, build separate tests using provider factories and explicit credentials; do not turn this unit-sized test into a network smoke.

Next: the realistic Product Catalog example or deterministic testing.