|
| 1 | +# Two fictional GP practices sharing one squad design |
| 2 | + |
| 3 | +An example for `nhs-test`: two assistants, one standalone handoff tool and two squads. |
| 4 | +Each squad appends its own inline transfer tool to both shared assistants. |
| 5 | +The squads differ in name, `membersOverrides.variableValues` and literal transfer |
| 6 | +numbers. Shared prompts and model/voice settings live |
| 7 | +under `templates/`; nothing under `examples/` is automatically deployed. |
| 8 | + |
| 9 | +This is not an NHS service or a medical triage system. Do not use real patient |
| 10 | +information. Mailboxes are fictional and numbers are in Ofcom's London drama |
| 11 | +range (+44 20 7946 0000–0999). The prompts prohibit telephone transfers; the |
| 12 | +inline transfer tools demonstrate practice-specific destinations. The appointments |
| 13 | +handoff is between assistants and can be tested later on an approved web call. |
| 14 | + |
| 15 | +The low-cost configuration is OpenAI `gpt-4.1-mini`, `maxTokens: 400`, and the |
| 16 | +Vapi `Elliot` voice, as used by the repository's promotion example. API acceptance, |
| 17 | +provider availability, billing and voice behaviour still require live verification. |
| 18 | + |
| 19 | +## Why transfer numbers are literal |
| 20 | + |
| 21 | +The Vapi API rejects Liquid in transfer number destinations. In the Vapi source, |
| 22 | +`libs/core/src/types/tool.types/transferCallTool.types.ts:1064–1087` requires |
| 23 | +E.164 by default. Disabling `numberE164CheckEnabled` still enforces |
| 24 | +`/^\+?[a-zA-Z0-9]+$/`, which rejects Liquid braces and underscores. Each squad |
| 25 | +therefore defines an inline `transferCall` tool in `membersOverrides['tools:append']` |
| 26 | +with literal E.164 numbers. The numbers also remain in `variableValues` for the |
| 27 | +shared handover prompt; keep both representations in sync. |
| 28 | + |
| 29 | +## Validate without connecting an org |
| 30 | + |
| 31 | +In a separate scratch copy of the engine, copy this example's `resources/` and |
| 32 | +`templates/` to that copy's root, then run: |
| 33 | + |
| 34 | +```bash |
| 35 | +VAPI_PRIVATE_API_KEY_NHS_TEST=validate-only npm run validate -- nhs-test --strict |
| 36 | +``` |
| 37 | + |
| 38 | +To demonstrate `variable-undefined`, temporarily remove `practice_mailbox` from |
| 39 | +`resources/nhs-test/squads/nhs-test-practice-b.yml`. Validation warns for practice-b's |
| 40 | +two members, not practice-a. Restore it before deployment. Standalone assistants |
| 41 | +are intentionally not checked for call-time variables. |
| 42 | + |
| 43 | +## Existing production org: not an isolated namespace |
| 44 | + |
| 45 | +`nhs-test` is a local folder name, not a new Vapi org. The API key chooses the |
| 46 | +actual org. Prefixes reduce name collisions but are not access controls. |
| 47 | +Do not use `setup --resources none` as a promise of empty state: it bootstraps |
| 48 | +the whole org's remote resource mappings. Never use `--force`, `--bootstrap`, |
| 49 | +`--overwrite`, cleanup or an unscoped apply for this experiment. |
| 50 | + |
| 51 | +Before any approved write, recheck remote names (including tool `function.name`) |
| 52 | +and slugified names for collisions, review the engine-generated state, and run |
| 53 | +a file-scoped push with `--dry-run --strict`. New files normally stop at the |
| 54 | +new-file gate; add `--allow-new-files` only after the owner confirms these exact |
| 55 | +five files are intentionally new. Review every planned POST/PATCH/DELETE. Expect |
| 56 | +five POSTs and zero PATCHes/DELETEs on a fresh deployment; stop otherwise. |
| 57 | +If the handoff tool already exists, the required continuation gate is four POSTs, |
| 58 | +zero PATCHes and zero DELETEs: stop if the engine would PATCH the existing tool. |
| 59 | +Dry-run skips live dependency-name lookups, so it is not proof against adoption |
| 60 | +of an existing remote resource during a later real push. Recheck the live |
| 61 | +inventory immediately before an approved write, not just the dry-run output. |
| 62 | + |
| 63 | +`.vapi-ignore` is a denylist, not a prefix allowlist: `!` negation is unsupported. |
| 64 | +Unrelated resources can be explicitly opted out by their engine IDs. Do not |
| 65 | +copy private inventories, org state, pins or credentials into this public example. |
| 66 | +No org connection, phone number purchase, call or API write is part of this example. |
0 commit comments