yr.gen

gen(
    on_wire: bool = True,
    instruction: str | None = None,
    **kwargs,
) → str

Generate a response from the active LLM with optional instruction and visibility control.

Parameters

on_wire
type: bool = True

Whether to include the response back in the LLM context.

instruction
type: str | None = None

Optional system instruction to guide generation (e.g., for structured outputs).

**kwargs
type: _GenerationOption

Additional keyword arguments passed directly to the underlying LLM (e.g., temperature, max_tokens, etc.).

Returns

type: str

The generated text response from the LLM.

Examples

Generate from previously inserted context while controlling whether the result remains in the conversation:

python
import yera as yr

yr.insert("The garden is small, shaded, and has clay soil.")

suggestions = yr.gen(
    instruction="Suggest three suitable plants.",
    on_wire=True,
)