# `Rho.Artifacts`
[🔗](https://github.com/GenericJam/rho/blob/v0.1.0/lib/rho/artifacts.ex#L1)

The output budget: a tool result over 16 KiB goes to
the model as its head and tail with a marker in the middle; the full
text is kept as an artifact the agent reads back with the `read_artifact`
tool, a page of lines at a time.

Artifacts live in `<data dir>/artifacts/<session id>/<call id>.txt` and
are addressed by the call id (`artifact://<call id>`), so a session only
sees its own.

# `budget`

```elixir
@spec budget() :: pos_integer()
```

Bytes a tool result may have before it's spilled.

# `find`

```elixir
@spec find(Path.t(), String.t(), String.t()) :: {:ok, Path.t()} | {:error, :not_found}
```

The artifact's file, or `{:error, :not_found}`.

# `limit`

```elixir
@spec limit(String.t(), Path.t(), String.t(), String.t()) :: String.t()
```

The text to give the model for a tool result, spilling it to an artifact if it's over budget.

---

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