> ## Documentation Index
> Fetch the complete documentation index at: https://askmarvin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# run

# `marvin.fns.run`

## Constants

### `T`

```python theme={null}
T = TypeVar('T')
```

## Functions

### `run`

```python theme={null}
def run(instructions: str | Sequence[UserContent], result_type: type[T] = str, tools: list[Callable[..., Any]] = [], thread: Thread | str | None = None, agents: list[Actor] | None = None, raise_on_failure: bool = True, handlers: list[Handler | AsyncHandler] | None = None, **kwargs: Any = {}) -> T
```

### `run_async`

```python theme={null}
def run_async(instructions: str | Sequence[UserContent], result_type: type[T] | Annotated[T, Any] = str, tools: list[Callable[..., Any]] = [], thread: Thread | str | None = None, agents: list[Actor] | None = None, handlers: list[Handler | AsyncHandler] | None = None, raise_on_failure: bool = True, **kwargs: Any = {}) -> T | AsyncGenerator[Event, None]
```

### `run_stream`

```python theme={null}
def run_stream(instructions: str | Sequence[UserContent], result_type: type[T] = str, tools: list[Callable[..., Any]] = [], thread: Thread | str | None = None, agents: list[Actor] | None = None, raise_on_failure: bool = True, handlers: list[Handler | AsyncHandler] | None = None, **kwargs: Any = {}) -> AsyncGenerator[Event, None]
```

### `run_tasks`

```python theme={null}
def run_tasks(tasks: list[Task[Any]], thread: Thread | str | None = None, raise_on_failure: bool = True, handlers: list[Handler | AsyncHandler] | None = None) -> list[Task[Any]]
```

Run tasks either concurrently (if independent) or sequentially.

### `run_tasks_async`

```python theme={null}
def run_tasks_async(tasks: list[Task[Any]], thread: Thread | str | None = None, raise_on_failure: bool = True, handlers: list[Handler | AsyncHandler] | None = None) -> list[Task[Any]] | AsyncGenerator[Event, None]
```

Run tasks either concurrently (if independent) or sequentially via orchestrator.

### `run_tasks_stream`

```python theme={null}
def run_tasks_stream(tasks: list[Task[Any]], thread: Thread | str | None = None, raise_on_failure: bool = True, handlers: list[Handler | AsyncHandler] | None = None) -> AsyncGenerator[Event, None]
```

***

**Parent Module:** [`fns`](marvin-fns)
