Documentation index for AI agents: see /llms.txt. Markdown versions of every page are available at <path>.md or via Accept: text/markdown.
Reference

Prompts

Layered prompt rendering. layered_prompt(...) produces deterministic text and a SHA-256 cache key derived from the rendered output.

Layered prompt rendering. layered_prompt(...) produces deterministic text and a SHA-256 cache key derived from the rendered output.

layered_prompt

layered_prompt(*, identity: 'str', communication: 'TextSection' = None, operational_rules: 'TextSection' = None, tools: 'Iterable[ToolPromptInput] | None' = None, domain_knowledge: 'StructuredSection' = None, safety: 'TextSection' = None, output_format: 'StructuredSection' = None, examples: 'StructuredSection' = None) -> 'LayeredPrompt'

ParameterTypeDefault
identitystrrequired
communicationTextSectionNone
operational_rulesTextSectionNone
toolsIterable[ToolPromptInput] | NoneNone
domain_knowledgeStructuredSectionNone
safetyTextSectionNone
output_formatStructuredSectionNone
examplesStructuredSectionNone

Returns: LayeredPrompt

Build the sanctioned Flow AI layered prompt shape.

The returned text is deterministic for identical inputs. The cache key is the SHA-256 hash of the rendered prompt text, so changing any rendered section changes the key. Empty sections are omitted.

Args: identity: Who the agent is. Required; string or sequence of strings rendered as a bullet list. communication: Tone and audience guidance; string or sequence of strings. operational_rules: Behavioral rules; string or sequence of strings. tools: Tool rows rendered as a Markdown table: ToolSpec values, mappings with name / description / approval, or plain names. Duplicate names keep the first row. domain_knowledge: Business context; a string, or any JSON-serializable structure rendered as a JSON code block. safety: Safety constraints; string or sequence of strings. output_format: Expected output shape; string or JSON-serializable structure. examples: Worked examples; string or JSON-serializable structure.

Returns: A LayeredPrompt with the rendered text and its deterministic cache key.

Raises: TypeError: If a text section is not a string or sequence of strings, or a structured section contains values that cannot be rendered as JSON.

LayeredPrompt

LayeredPrompt(text: 'str', cache_key: 'str') -> None

ParameterTypeDefault
textstrrequired
cache_keystrrequired

Returns: None

Rendered layered prompt plus its deterministic prompt cache key.