Skip to main content
@marvin.fn uses a function’s signature, docstring, and arguments to create a task. Its return annotation defines the result type.
The function body does execute to supply additional context to the model. Leave it as ... if no context is needed. Its ordinary return value is context, not the final generated result.

Configure the task

Set instructions, agent, thread, or prompt on the decorator. Calls also accept _agent, _thread, and _instructions overrides.
as_task creates the task without a model request, but still executes the function body to collect context. For async usage, decorate an async def function and await the call. See the API reference.