From cbefc3b8bdeab175a27a642a4afcf27e57d721eb Mon Sep 17 00:00:00 2001 From: Rizel Scarlett Date: Sun, 28 Sep 2025 23:46:59 -0400 Subject: [PATCH] Fiie input recipe ref doc (#4869) --- .../docs/guides/recipes/recipe-reference.md | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/documentation/docs/guides/recipes/recipe-reference.md b/documentation/docs/guides/recipes/recipe-reference.md index 67cd6ccbf9..5ae27570c2 100644 --- a/documentation/docs/guides/recipes/recipe-reference.md +++ b/documentation/docs/guides/recipes/recipe-reference.md @@ -104,7 +104,7 @@ Each parameter in the `parameters` array has the following structure: | Field | Type | Description | |-------|------|-------------| | `key` | String | Unique identifier for the parameter | -| `input_type` | String | Type of input (e.g., "string") | +| `input_type` | String | Type of input: `"string"` (default) or `"file"` (reads file contents) | | `requirement` | String | One of: "required", "optional", or "user_prompt" | | `description` | String | Human-readable description of the parameter | @@ -122,22 +122,33 @@ Each parameter in the `parameters` array has the following structure: The `required` and `optional` parameters work best for recipes opened in Goose Desktop. If a value isn't provided for a `user_prompt` parameter, the parameter won't be substituted and may appear as literal `{{ parameter_name }}` text in the recipe output. +### Input Types + +- `string`: Default type. The parameter value is used as-is in template substitution +- `file`: The parameter value should be a file path. goose reads the file contents and substitutes the actual content (not the path) into the template + +When using `input_type: file`, this is useful for including file contents directly in your prompts or instructions. + +**Example:** +```yaml +parameters: + - key: source_code + input_type: file + requirement: required + description: "Path to the source code file to analyze" + +prompt: "Please review this code:\n\n{{ source_code }}" +``` + +When you run this recipe with `source_code: /path/to/app.py`, Goose will read the contents of `app.py` and substitute the actual code into the `{{ source_code }}` placeholder. + :::important - Optional parameters MUST have a default value specified - Required parameters cannot have default values -- File parameters cannot have default values regardless of requirement type +- File parameters cannot have default values regardless of requirement type to prevent unintended importing of sensitive files - Parameter keys must match any template variables used in instructions or prompt ::: -#### File Parameter Type - -When using `input_type: file`, the parameter value should be a file path. At recipe execution time, Goose will: - -1. **Read the file contents** from the provided path -2. **Replace the parameter** with the actual file contents in the recipe template - -**Security Consideration**: File parameters **cannot have default values** to prevent unintended importing of sensitive files - ## Extensions The `extensions` field allows you to specify which Model Context Protocol (MCP) servers and other extensions the recipe needs to function. Each extension in the array has the following structure: