Execute AI tasks with a single line of code
run
function is the simplest way to execute AI tasks in Marvin. It provides a clean, one-line interface for running tasks while handling all the complexity of task creation and execution under the hood.
run
function provides:
Output
instructions
: What you want the AI to doresult_type
: The expected type of the result (defaults to str
)tools
: Optional list of functions the AI can usethread
: Optional thread for conversation contextagents
: Optional list of agents to useraise_on_failure
: Whether to raise exceptions on failure (defaults to True
)handlers
: Optional list of handlers for events**kwargs
: Additional context passed to the taskrun_tasks
function allows you to run multiple tasks at once: