yr.app
app(
fn: Callable | None = None,
name: str | None = None,
description: str | None = None,
model: LLMContext | None = None,
sys_prompt: str | None = None,
) → AppFunctionWrapper | Callable[[Callable], AppFunctionWrapper]Decorator that turns a Python function into a Yera app.
Usable bare (@app) or with keyword arguments
(@app(name=..., model=..., sys_prompt=...)). The wrapped
function's signature is validated against Yera's supported type system
at decoration time; arguments and return values are coerced at call
time.
Parameters
The function being decorated when used bare. Left as None
when the decorator is invoked with arguments.
Display name for the app. Defaults to the function's
__name__.
Optional human-readable description recorded in the app metadata.
Optional LLMContext
entered for the duration of each run. Falls back to the active
profile's default model if omitted.
Optional system prompt emitted once the model context is entered.
Returns
An AppFunctionWrapper callable that runs the function under the Yera event-stream runtime when invoked. When called with arguments (fn is None), returns a decorator that produces the wrapper.