liveBook · Manning

Output format

As explained in Introduction to Generative AI, Second Edition

Structured output is machine-readable model output organized according to a specified format rather than unrestricted prose.

Structured output is model-generated content organized for a purpose, such as making a tool call or taking another action, rather than only producing a text response. An AI agent can use actions alongside or instead of text, then incorporate tool results into its response. Models can learn this behavior through fine-tuning, few-shot prompting, or reinforcement learning; the interaction setup, or scaffolding, also affects performance. section 8.11

Table 8.1 Sample API tool calls and output formats [49]

API name

Example input

Example output

Question answering

“Where was the Knights of Columbus founded?”

“New Haven, Connecticut”

Wikipedia search

“Fishing Reel Types”

“Spin fishing > Spin fishing is distinguished between fly fishing and bait cast fishing by the type of rod and reel used. There are two types of reels used when spin fishing, the open-faced reel and the closed-faced reel.”

Calculator

“27 + 4 * 2”

“35”

Calendar

(none)

Today is Monday, June 30, 2025.

Machine translation

“sûreté nucléaire”

“nuclear safety”

Compare sample API inputs and outputs for question answering, search, calculation, calendars, and translation. section 8.11

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Explains action-shaped outputs, ways to teach them, and scaffolding’s effect, but gives no implementation details for a specific format.
Examples
Illustrates tool inputs and outputs with question answering, Wikipedia search, a calculator, a calendar, and machine translation.
What you can do after
Understand how language models can produce actions and how prompting or training can teach that behavior.
How it connects
Connects structured output to AI agents, tool use, fine-tuning, few-shot prompting, and reinforcement learning.

Also explained in

Compare how 10 books explain output format →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.