liveBook · Manning

PromptRunner

As explained in Spring AI in Action

PromptRunner is an Embabel API for sending prompts to a large language model and binding responses to objects.

PromptRunner is an Embabel API that sends a rendered prompt to a large language model and binds the response to a Java object. Use PromptRunner.usingLlm().createObject(prompt, TargetType.class) inside an agent action. section 12.3.2

Deriving game mechanics

An @Action method accepts GameRules, renders rulesText into a mechanics prompt, and returns PromptRunner.usingLlm().createObject(prompt, GameMechanics.class).

How Spring AI in Action covers it

How deep it goes
Explains template injection, placeholder rendering, and typed binding, while leaving lower-level LLM communication implicit.
Examples
Demonstrates extracting game titles and deriving game mechanics or player counts from board-game rules.
What it assumes
Assumes Java, Spring resource injection, and Embabel action concepts while supplying UserInput through agent interaction.
What you can do after
Builds Embabel actions that obtain structured Java results from rendered prompts without directly using ChatClient.
How it connects
Connects PromptRunner with Embabel agents, actions, prompt templates, StringTemplate, Spring Resource, and Java records.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.