Metadata
Prompts use script({ ... })
function call
to configure the title and other user interface elements.
The call to script
is optional and can be omitted if you don’t need to configure the prompt.
However, the script
argument should a valid JSON5 literal as the script is parsed and not executed when mining metadata.
Title, description, group
The title
, description
and group
are (optionally) used in the UI to display the prompt.
system
Override the system prompts included with the script. The default set of system prompts is inferred dynamically from the script content.
model
You can specify the LLM model
identifier in the script.
The IntelliSense provided by genaiscript.g.ts
will assist in discovering the list of supported models.
Use large
and small
aliases to select default models regardless of the configuration.
maxTokens
You can specify the LLM maximum completion tokens in the script. The default is unspecified.
maxToolCalls
Limits the amount of allowed function/tool call during a generation. This is useful to prevent infinite loops.
temperature
You can specify the LLM temperature
in the script, between 0
and 2
. The default is 0.8
.
top_p
You can specify the LLM top_p
in the script. The default is not specified
seed
For some models, you can specify the LLM seed
in the script, for models that support it. The default is unspecified.
Other parameters
unlisted: true
, don’t show it to the user in lists. Templatesystem.*
are automatically unlisted.
See genaiscript.d.ts
in the sources for details.
env.meta
You can consult the metadata of the top level script in the env.meta
object.
Model resolution
Use the host.resolveModel
function to resolve a model name or alias to its provider and model name.