Skip to main content
Expressions appear in provider settings, model settings, dynamic blocks, agent instructions, bindings, and final outputs.

Literals

"hello"
123
12.5
true
false

References

input.topic
secrets.api_key
agent.extract.summary
dynamic.project_context
Use .*. to pluck a field from each item in an array. The result is an array of the selected values.
input.attachments.*.video_url
dynamic.video_recording_answers.answers.*.url
For example, if attachments is [{ video_url: "a.mp4" }, { video_url: "b.mp4" }], then input.attachments.*.video_url evaluates to ["a.mp4", "b.mp4"]. Missing fields, non-object items, and null values become null. Use .**. to filter those null values out, or .***. to reject null and mixed-type plucked values. These operators are only valid on arrays.

Arrays and objects

["bug", "feature", "question"]

{
    project_id: input.project_id
    task_id: input.task_id
}

Dynamic blocks

A dynamic block builds an object at runtime. Each field is evaluated as a normal expression.
dynamic {
    example: 123
    readme: read resource.project_readme
    instructions: render prompt.writer_instructions
    another: {
        value: 123
    }
}
Dynamic fields may contain literals, object values, resource reads, prompt renders, agent outputs, tool calls, and other supported runtime expressions.

Assets

Use asset to attach model-supported assets to an instruction. The source can be a URL, a data:*;base64,... value, a runtime string expression, or an array of strings.
agent analyzer {
    model: model.vision

    instruction: "What is in this image? {{ asset input.image_url }}"

    output {
        result: string
    }
}
Assets can also be stored in dynamic blocks and referenced later.
dynamic {
    image: asset "https://example.com/image.png"
    video: asset "https://example.com/demo.mp4" {
        type: "video"
        media_type: "video/mp4"
    }
    videos: asset input.attachments.*.video_url {
        type: "video"
    }
}
Supported asset options are:
OptionPurpose
typeExplicit asset kind: image, video, or document.
media_typeExplicit MIME type such as image/png, video/mp4, or application/pdf.
titleOptional title for document-like assets.
contextOptional context for document-like assets.
citationsEnables or disables provider citations when supported.
Model profiles must declare the asset kinds they support with assets.

Tool calls

Use bindings {} to assign runtime values to the tool input schema.
dynamic {
    task: call tool.fetch_task {
        bindings {
            task_id: input.task_id
        }
    }
}

Resources and prompts

dynamic {
    readme: read resource.project_readme
    instructions: render prompt.writer_instructions
}

Context continuation

agent continue_investigation {
    context: agent.investigate_task
}
context: agent.name passes the prior agent’s message history so another agent can continue the work.