Detroit AI Player
The adapter lets a typed classifier choose among a game's existing actions while enforcing that the answer is one of the offered options and has the highest reported probability.
The adapter lets a typed classifier choose among a game's existing actions while enforcing that the answer is one of the offered options and has the highest reported probability.
When the narrative-game runner uses the TypeSafe provider, it sends one typed Choice question for the current decision node. Jev sees the role/persona and conversation history in the state plus the player-facing candidate text. The runner maps the selected ordinal back to the game option ID; it records probabilities and model metadata, while reasoning remains null.
Using the full history and the final scene, which action would the character take?
Pinned English chapter 1 node n001_fish: hallway debris, a broken tank, a flopping fish, and urgent activity ahead. The TypeSafe adapter passes the filtered conversation messages as state.messages. Ordinal1 means pick up the fish and place it back in the tank; ordinal2 means ignore the fish and head into the apartment.
The runner supplies its filtered messages and available game choices to the selected model provider.
The TypeSafe adapter assigns ordinal keys to player-facing option text and places messages in state.messages.
The adapter validates the choice, per-option probabilities, confidence, model version, and usage, then maps the ordinal to the game option ID and returns decision metadata to the runner.
The runner stores raw response and probability metadata; later history includes the selected option ID and text.
The adapter lets a typed classifier choose among a game's existing actions while enforcing that the answer is one of the offered options and has the highest reported probability. Internal option IDs stay outside the API request, and invalid responses fail rather than silently selecting a fallback.