yr.insert

insert(
    prompt: str,
) → None

Insert a prompt into the active LLM context.

Unlike response, this does not generate a response; it merely appends the given prompt to the conversation history.

Parameters

prompt
type: str

The user message to insert into the LLM context.

Examples

Add facts to the shared conversation before generating a response:

python
import yera as yr

yr.insert("The birthday party has twelve guests.")
yr.insert("Two guests are vegetarian.")

menu = yr.gen(
    instruction="Suggest a simple buffet menu.",
    on_wire=True,
)