From 003bebd1e38ec8cfe4fe11c5b00c06b13c853b60 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 13 Nov 2026 18:26:44 -0800 Subject: [PATCH] Declare the `name` argument in the `greet` sample A prompt's arguments are one JSON object that the `args:` key declares, and the shipped `greet` prompt declares a required string `name` and reads `args.name`. The `greet` sample in `README.md` now matches it. - The sentence after the sample gives the arguments of the run as `{"name":"Ada"}` and says what the `args:` key declares. - The sample's result is the same. Plan: runvil-harness/plan/2026-11-13-3-json-args.plan.md --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d91d63aec..7a84105de 100644 --- a/README.md +++ b/README.md @@ -42,17 +42,21 @@ This is [`prompts/greet.md`](https://github.com/cppalliance/runvil-harness/blob/ ````markdown --- name: greet -description: Greet the named input using a Lua-computed value +description: Greet a name using a Lua-computed value runvil: 0 +args: + type: object + properties: + name: { type: string, description: The name to greet } + required: [name] --- -Computes a greeting from the input in Lua, substitutes it into the prose, and -has the model echo it. +Computes a greeting for its `name` argument in Lua, substitutes it into the prose, and has the model echo it. ## Main ```lua -var.greeting = "Hello, " .. args .. "!" +var.greeting = "Hello, " .. args.name .. "!" ``` Repeat exactly, with no extra words: {{ var.greeting }} @@ -62,7 +66,7 @@ return models.infer(prose) ``` ```` -The prompt declares no models, so `models.infer(prose)` runs on the Host's default model. Given the input `Ada`, the first block in `## Main` builds `Hello, Ada!`, the placeholder puts it into the prose, and `models.infer(prose)` sends that prose to the model. The model's reply is the run's result. A prompt can pick another of the five roles (`default`, `strong`, `small`, `fast`, `creative`) with `models.use(role)`, and the Host decides which model fills each role. The paragraph above `## Main` never reaches the model, because text before the first heading with no Lua block in it is a comment. +The `args:` key declares the one argument the prompt takes, a required string named `name`. The prompt declares no models, so `models.infer(prose)` runs on the Host's default model. Given the arguments `{"name":"Ada"}`, the first block in `## Main` builds `Hello, Ada!`, the placeholder puts it into the prose, and `models.infer(prose)` sends that prose to the model. The model's reply is the run's result. A prompt can pick another of the five roles (`default`, `strong`, `small`, `fast`, `creative`) with `models.use(role)`, and the Host decides which model fills each role. The paragraph above `## Main` never reaches the model, because text before the first heading with no Lua block in it is a comment. ## How it fits together