Assistant
An assistant message is a role-labeled conversational message containing content generated by an AI assistant or language model.
Spring AI in Action
An assistant message is a message containing a response generated by a language model.
- How it is used
- Represents model-generated contributions in prompts, multiturn conversations, and tool-driven API interactions.
- How deep it goes
- Defines the role and shows response and tool-call payloads, but defers broader conversation implementation to later treatment.
- Examples
- Uses a current-time question, a getCurrentTime tool request, a tool result, and a final time answer.
- What you can do after
- Evaluate assistant payloads and follow tool_calls through the application’s multipart conversation.
AI for Everyday IT
An assistant role is a conversational API message role containing the model-generated response to user input.
- How it is used
- Represents the model-generated answer within an API conversation for applications such as a database copilot.
- How deep it goes
- Defines the role and shows its JSON structure, without explaining model internals or response generation.
- Examples
- Uses a JSON response listing customers from Belgium in the Northwind database.
- What you can do after
- Apply it via an OpenAI API payload to represent generated answers in a conversational application.
Prompt Engineering in Practice
An assistant message is a conversational message representing content generated by the model.
- How it is used
- Represents the model-generated response in a chat conversation and supplies context for subsequent turns.
- How deep it goes
- Defines the message’s role and demonstrates it in troubleshooting; leaves few-shot prompting for later treatment.
- Examples
- Uses an API troubleshooting exchange in which the assistant requests diagnostic details before offering likely causes.
- What you can do after
- Evaluate message placement by distinguishing generated assistant responses from designed system instructions and user inputs.
Read how Prompt Engineering in Practice explains assistant →
Related concepts
- few-shot prompt contextused by · Few-shot prompt context is input to a model that includes a small number of examples to guide its response or behavior.
- dialoguepart of · Dialogue is an ordered exchange of related messages across successive turns between participants or an interactive system and its users.
- contextuses · Context is the surrounding information, state, or circumstances that condition how an entity, event, or task is interpreted or how a system behaves.
- system promptconfigured by · A system prompt is a high-priority instruction or context supplied to an AI model to establish its role, task, behavioral guidance, or constraints.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


