yr.condition

condition(
    instruction: str,
    on_wire: bool = False,
    **kwargs,
) → bool

Use the active LLM to evaluate a boolean condition.

Parameters

instruction
type: str

Instruction text describing what the condition checks.

on_wire
type: bool = False

Whether the field should be included in LLM context (default: False).

**kwargs
type: _GenerationOption

Additional keyword arguments passed to the model fill method.

Returns

type: bool

Boolean value representing whether the condition holds.

Examples

Check a fact established in the conversation without retaining the generated decision:

python
import yera as yr

is_weekend_trip = yr.condition(
    "Is the requested journey shorter than three days?",
    on_wire=False,
    temperature=0,
)