yera.dsl.control
Module containing Yera DSL constructs for control flow using LLMs.
Symbols
Condition
StructRepresents a boolean condition with instruction.
Attributes
Boolean indicating whether the condition holds.
condition
condition(
instruction: str,
on_wire: bool = False,
**kwargs,
) → boolUse the active LLM to evaluate a boolean condition.
Parameters
Instruction text describing what the condition checks.
Whether the field should be included in LLM context (default: False).
Additional keyword arguments passed to the model fill method.
Returns
Boolean value representing whether the condition holds.
Option
Represents a single option in a selection.
Attributes
The label shown for the option.
Optional detailed description of the option.
option
option(
label: str,
description: str | None = None,
) → OptionCreate an Option instance.
Parameters
The visible label for the option.
Optional descriptive text.
Returns
An Option instance with given label and description.
select
select(
*options,
instruction: str | None = None,
name: str = 'Selection',
on_wire: bool = False,
**kwargs,
) → strUse the active LLM to choose between a set of options.
Parameters
One or more option labels or Option instances.
Instruction text to describe the purpose of this selection.
Name for the generated class (default: "Selection").
Whether the field should be included in the LLM context (default: False).
Additional keyword arguments passed to the model fill method.
Returns
The selected option
Raises
If fewer than two options are provided or labels are not unique.