liveBook · Manning

Clarifying question

As explained in Coding with AI

A question asked to obtain missing information needed to specify a task, audience, tone, or constraint.

A clarifying question obtains missing context before a task is completed. In prompt engineering, it narrows the intended audience, tone, output format, tools, and constraints so the resulting prompt fits its use case. section 9.3.1 section 9.3

Useful clarifying questions ask about:

  • The target audience: beginner, intermediate, or advanced Python programmers. section 9.3.1
  • The desired tone: formal and technical or casual and explanatory. section 9.3.1
  • The output format: code snippets, bullet points, or a step-by-step guide. section 9.3.1
  • The tools or libraries and any special constraints that affect the answer. section 9.3.1 section 9.3

Refining an API-request prompt

Given “Act as an expert Python programmer. Give me instructions on how to send an HTTP request to an API and display the response,” ask clarifying questions before rewriting it. The answers can determine whether the result should target beginners, use a particular tone, include code, follow steps, or rely on specified libraries. section 9.3.1

Use clarifying questions before optimization, not as decoration. Gather essential context, then refine the prompt for clarity, precision, and output quality; review the result because language models provide no guarantees. section 9.3.1 section 9.3

How Coding with AI covers it

How deep it goes
Demonstrates question categories and places them within a sequential, iterative prompt-refinement process.
Examples
Uses an API-request prompt and asks about audience, tone, output format, tools, libraries, and constraints.
What it assumes
Assumes a draft prompt exists and teaches users to identify missing audience, tone, format, tool, and constraint details.
What you can do after
Apply it to gather missing context and produce more specific prompts for particular uses or AI models.
How it connects
Connects prompt engineering with contextual awareness, prompt optimization, and iterative refinement.

Also explained in

Compare how 2 books explain clarifying question →

Related concepts

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