Skip to content

Commit e64ffa3

Browse files
docs(blocks): a worked guide for running many locations from one set of prompts
The blocks page is a reference. This adds the path through it for someone who runs the same agent at several locations: move pasted wording and settings into blocks, deploy, give one location its own wording or setting, change a shared block through a pull request, roll it out, and what promotion and pull do along the way. Every command in the guide was run in a scratch copy with the example's two clinics against a local stand-in for the API, and the page says so. It also states three things the reference pages leave implicit: promotion copies every file in the pipeline's patterns, a block used only outside those patterns stays on the sync-blocks list after a promotion, and pushing a file does not remove a setting that exists only in the dashboard. The blocks page said "to discard the dashboard edit, change nothing". That holds for a value the file sets. It now also says that a field the file does not set stays as the dashboard left it, and that naming the field in the file is how to clear it, marked as seen on the stand-in. README, the blocks, promotion and file-formats pages, the example's README and AGENTS.md link to the guide. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
1 parent 55ea182 commit e64ffa3

7 files changed

Lines changed: 647 additions & 3 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ For changes under `src/`, `tests/` or `.github/`:
434434
| --- | --- |
435435
| Every resource setting, with examples | [Resource reference](docs/guides/resource-reference.md) |
436436
| Minimal tested files | [File formats](docs/guides/file-formats.md), [`examples/starter/`](examples/starter/README.md) |
437-
| Shared prompt text and config | [Blocks](docs/guides/blocks.md), [`examples/blocks/`](examples/blocks/README.md) |
437+
| Shared prompt text and config | [Blocks](docs/guides/blocks.md), [`examples/blocks/`](examples/blocks/README.md), [many locations walk-through](docs/guides/many-locations.md) |
438438
| System prompts | [Writing system prompts](docs/guides/writing-prompts.md), [Vapi Prompt Optimization Guide](docs/Vapi%20Prompt%20Optimization%20Guide.md) |
439439
| Commands, flags, test-call output | [Commands](docs/guides/commands.md) |
440440
| Sync, conflicts, drift, output icons | [How the engine works](docs/guides/how-it-works.md), [sync behavior](docs/learnings/sync-behavior.md) |

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ when run without arguments. Full flags and examples:
245245
| [Everyday workflows](docs/guides/workflows.md) | Deploy, pull safely, recover from a bad deploy, clean up |
246246
| [File formats](docs/guides/file-formats.md) | Write assistants, tools, squads, structured outputs and simulations |
247247
| [Blocks](docs/guides/blocks.md) | Share prompt text and config between assistants, squads and orgs |
248+
| [Many locations, one set of prompts](docs/guides/many-locations.md) | Run several locations from shared wording: a worked path from pasted copies to a rolled-out edit |
248249
| [Resource reference](docs/guides/resource-reference.md) | Look up every setting, with examples |
249250
| [Writing system prompts](docs/guides/writing-prompts.md) | Structure a voice agent's prompt |
250251
| [PR checks](docs/guides/pr-checks.md) | Test every pull request with simulations |

‎docs/guides/blocks.md‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ Every snippet below is a file from [`examples/blocks/`](../../examples/blocks/),
3030
two clinics that share a red-flags block and a voice. CI checks that the
3131
snippets match the files and that the example passes `validate`.
3232

33+
This page is the reference. For the whole job in order, from pasted copies
34+
to an edit rolled out through a pull request, see
35+
[Running many locations from one set of prompts](many-locations.md).
36+
3337
## Prompt blocks
3438

3539
Put the shared text in a Markdown file:
@@ -311,10 +315,26 @@ to yours, which git and the engine ignore. To resolve a dashboard edit:
311315
2. If the change is in text that comes from your file, make the same change
312316
in your file. If it is in text that comes from a block, change the block
313317
(every resource that uses it changes too) or give this org its own block.
314-
To discard the dashboard edit, change nothing.
318+
To discard a dashboard edit to a value your file sets, change nothing.
315319
3. Run `npm run apply -- <org> --resolve=ours <file>`. It pushes your
316320
version over the dashboard's.
317321

322+
The push carries only the fields your file sets (see
323+
[PATCH semantics](../learnings/assistants.md#patch-assistantid-semantics-shallow-replacement-at-the-top-level-field)),
324+
so what it undoes depends on the field. This was seen on a local stand-in
325+
for the API, not on a live org:
326+
327+
- **A value your file sets is put back.** A greeting changed in the dashboard
328+
went back to the greeting in the file.
329+
- **A field your file does not set stays as the dashboard left it.** A
330+
greeting added in the dashboard to an assistant whose file has no
331+
`firstMessage` was still there after the push, and the next `pull` no
332+
longer reported a dashboard edit.
333+
- **To clear such a field, name it in your file.** Give it the value you
334+
want. With `firstMessage: null` in the file, the engine sent the `null` and
335+
the stand-in cleared the greeting. Whether Vapi accepts `null` for a given
336+
field was not tried, so open the assistant after the push and check.
337+
318338
## Limits
319339

320340
- The drift check compares the dashboard with the last state *your* checkout

‎docs/guides/file-formats.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ Text or settings that several files share can live in one file under
185185
prompt, or a `$include: <name>` key in any mapping. An org can replace a
186186
shared block with its own. Syntax, merge rules and how a block change is
187187
rolled out: [Blocks](blocks.md), with a tested example in
188-
[`examples/blocks/`](../../examples/blocks/README.md).
188+
[`examples/blocks/`](../../examples/blocks/README.md). For several locations
189+
that share most of their prompts, start with
190+
[Running many locations from one set of prompts](many-locations.md).
189191

190192
## TypeScript resources (`.ts`)
191193

0 commit comments

Comments
 (0)