---
title: "Character variants"
slug: plugins/unity/Samples~/CharacterVariants
---

<a id="character-variants"></a>

Attach `CharacterVariantsExample` and `AstralRuntimeInitializer` to a GameObject.
The component exposes two focused paths:

- `PreparePromptCache` tokenizes and stores the system prompt, verifies the
  token entry, and saves a native cache snapshot. `RunCachedAgent` binds that
  cache to an agent and reports reused prompt tokens.
- `RunAdaptedSession` applies JSON-schema output, a stop sequence, and an
  optional model-scoped LoRA adapter with a configurable scale.

Set an adapter path only when the selected provider reports LoRA support. Adapter
ownership remains with the model and outlives the session that references it.

Source: [View the pinned source](https://github.com/Cosmin-B/astral-runtime/blob/f2d13b77c70624ede5bc06823d4a794a4b955e10/plugins/unity/Samples~/CharacterVariants/README.md) · [Edit this source](https://github.com/Cosmin-B/astral-runtime/edit/main/plugins/unity/Samples~/CharacterVariants/README.md)
