# `Omni.Context`
[🔗](https://github.com/aaronrussell/omni/blob/v1.2.1/lib/omni/context.ex#L1)

The context for a conversation with an LLM.

Wraps a system prompt, a list of messages, and a list of tools — passed as
the second argument to `Omni.generate_text/3` and `Omni.stream_text/3`.

# `t`

```elixir
@type t() :: %Omni.Context{
  messages: [Omni.Message.t()],
  system: String.t() | nil,
  tools: [Omni.Tool.t()]
}
```

System prompt, messages, and tools for a generation request.

# `new`

```elixir
@spec new(Enumerable.t() | String.t() | [Omni.Message.t()] | t()) :: t()
```

Creates a new context from a string, list of messages, keyword list, or map.

A string is treated as a single user message. A list is treated as messages.

# `push`

```elixir
@spec push(t(), Omni.Message.t() | [Omni.Message.t()] | Omni.Response.t()) :: t()
```

Appends messages to the context.

Accepts a single `%Message{}`, a list of messages, or a `%Response{}`
(extracts its `messages` field — the right choice after a tool loop).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
