liveBook · Manning

Prompt

As explained in Effective Conversational AI

A prompt is an input supplied to a language model that provides a task, instructions, context, or other conditioning information.

A chatbot may answer the wrong question even when the user has explained their need. A prompt gives a language model the task, instructions, context, and input it needs to produce a useful response. In a conversational assistant, it can combine a standing instruction with the user’s latest utterance; the resulting text is sent as the model’s input. section 2.3.1 section 2.3.2

From request to recipe

For “I need a quick recipe for peanut butter pie,” a recipe prompt first assigns the model a helpful kitchen-assistant role and asks it to create a recipe, then appends the entire user request. Capturing the whole utterance matters here: unlike a fixed cake-size choice, the requested dish is not drawn from a small set of options. section 2.3.2

Listing 2.4 Building the recipe prompt, which is stored in the recipe_prompt variable
"You are a helpful kitchen assistant. Create a recipe as instructed by 
the user.\n\nInput: ".append(recipe_query_text).append("\n\nOutput: ")

The recipe prompt shows the reusable instruction, the appended user request, and an output cue in one short example. section 2.3.2

Choose prompt content for the job. Context from trusted documents can guide an answer and reduce reliance on stale model knowledge. An instruction can instead ask for a specific behavior, such as greeting a customer and summarizing their problem after an intent has been classified. Examples can narrow an output format: an extraction prompt asking for IDs produced extra fields, while a more detailed one-shot example and explicit JSON keys brought the output closer to what the receiving application needed. section 1.2.2 section 5.4.2 section 12.3.2

Prompts are also useful for designing and testing conversations. A claim-status flow prompt can supply available claim fields, request a brief dialogue, and ask for a rationale. If the proposed flow asks for too much, a follow-up prompt can include the earlier exchange and request fewer required answers. To test the chatbot from the other side, prompt the model to act as a user, giving it a scenario, facts it knows or lacks, and the conversation so far. section 10.1.1 section 10.1.2 section 10.3.1

Treat a prompt as something to test, not a guarantee. Similar prompts—even ones with different spacing—can produce different flows. A model told to gather three claim details kept questioning a user who did not know them. Test across utterances and scenarios, provide an escape or human-review path where needed, and use input screening and output checks rather than relying on instructions alone to contain risk. section 10.1.1 section 10.2.1 section 1.2.2

How Effective Conversational AI covers it

How deep it goes
Works through prompt assembly, iterative instructions, simulated conversations, and extraction examples, while showing where prompting alone fails.
Examples
Uses a recipe request, an empathetic airline greeting, insurance-claim dialogues, simulated users, and transcript-to-JSON extraction.
What it assumes
Assumes familiarity with chatbot utterances and goals; introduces prompt assembly through a concrete assistant action.
What you can do after
Practice/perform prompt iteration for conversational tasks, then test outputs against user effort, required fields, and failure cases.
How it connects
Connects prompts to language models, retrieval-augmented generation, intent classification, dialogue flows, guardrails, and JSON extraction.

Also explained in

Compare how 50 books explain prompt →

Related concepts

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