-
Notifications
You must be signed in to change notification settings - Fork 1
Variables
theirish81 edited this page Dec 31, 2025
·
2 revisions
As the runner does its job, it has access to a wide variables, subdivided into multiple collections.
-
params: they are parameters passed to the Runner by the invoker -
context: it's the output data structure. Its content may vary based on which moment in the execution the variable is accessed -
vars: vars is a compound collection. It contains the global variables set at the session level, but its content can be overridden by variables set at the session level -
components: the reusable components collection.
Variable evaluation can happen in multiple places:
- All the expression fields, such as
iterateOnorexpression. These fields use Go Expr and the variables can be traversed using the dot notation. - All template-enabled text fields. These fields use Go Template. Some examples
are:
prompt,prePrompt, but also string variables invarsthemselves.
Notes:
- Expressions can return any sort of data type, but in certain situations a specific data type is expected by the
program. For example, the
iterateOnfield expects an array of strings. - Templates exclusively operate and return text, and have a recursive nature. So if the result of a template evaluation returns a string that contains another template, it'll be evaluated up to 3 depth levels.
Sessions do not share context. However, it's possible for a session to acquire in its own context the current
data structure state. To do so, add the instruction: context: true in a session definition. This will not transfer
the full context of a session to another, but simply give the LLM the ability to consult the already extracted data.