-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Please explain the motivation behind the feature request.
Sometimes you want to insert large blocks of text (for example, pull request diffs) into your recipe. This currently fails if the string is too long for a string parameter and directly adding the text into the recipe can fail if there are characters that bring the existing parameter templating.
By allowing the user to specify a file path and inserting the contents of the file into the recipe like other parameters we can work around these problems.
Describe the solution you'd like
There is an existing file RecipeParameterInputType that doesn't do anything right now from what I can tell, just a string and its undocumented. We can repurpose it for this work.
When a 'file' input type is used it will:
- Be validated to be an actual file path with a file present
- The contents of the file will be inserted at the templated parameter location
{{ FILE_PARAMETER }} - Default values will not be allowed with file parameters to avoid recipes trying to import sensitive user files
- The file path can be absolute or relative to the location goose is being called from (current working directory).
Describe alternatives you've considered
- Pass the file contents as a string to a string input type. This fails when the contents are too long for the cli.
- Directly insert the file contents into the recipe before running it (outside of goose), this can fail if there are characters that break normal goose parameter replacement (like {{ }} )
- Write files to the the file system and then tell in the recipe tell goose to read them. This works but:
- Less reliable for goose to read the whole content and all files
- Slower, requires multiple tool calls
- More expensive because of more agent turns
Additional context
None
#4042 is similar with a different proposed solution
- I have verified this does not duplicate an existing feature request