liveBook · Manning

Prompt

As explained in AI-Powered Developer: Build software with ChatGPT and Copilot

A natural language prompt is an instruction or query expressed in ordinary human language for directing an AI system.

A prompt is the input given to an AI model as an instruction or query. It may be a sentence, paragraph, or longer text, and its wording and surrounding context shape the response. section 2.1

Use prompts as practical steering tools:

  • Track previous prompts because the current session’s context can drastically change later results; begin a new session for each project. section 2.1
  • Refine requirements through successive prompts when the first response misses a constraint or produces an unsuitable solution. section 2.2 section 2.4
  • Adapt the interaction to the tool: ChatGPT supports dialogue, while Copilot and CodeWhisperer provide context-sensitive advice inside an IDE. section 2.4

Refining an algorithm prompt

A request for the kth smallest element in an unsorted array can yield a solution using full sorting. Add the constraint against sorting or built-in sorting functions to obtain a different approach, such as Copilot’s binary-search-style solution. Treat the result as a proposal: its apparent validity does not make it an acceptable interview answer without considering follow-up constraints. section 2.2

# You are a student with a background in computer science who is interviewing for an engineering job at a software company. You are asked the following question: based on the previous definition of a singly linked list (in Python), how would you write a method that would reverse the output of the traversal method? How would you implement such a method?

Use this realistic prompt as a template for specifying role, prior context, programming language, data structure, and the exact implementation task. section 2.2

How AI-Powered Developer: Build software with ChatGPT and Copilot covers it

How deep it goes
Explains prompts as model inputs and develops context-sensitive refinement through coding examples, without detailing model internals.
Examples
Uses linked-list reversal, kth-smallest selection, Flask setup, dashboard creation, memory-leak analysis, and refactoring requests.
What it assumes
Assumes awareness of session context and, for Copilot, a Python project inside a supported IDE.
What you can do after
Apply it via ChatGPT, GitHub Copilot, or CodeWhisperer to request code and refine requirements toward a desired result.
How it connects
Connects prompts with context, large language models, code generation, debugging, refactoring, IDEs, and algorithmic constraints.

Also explained in

Compare how 50 books explain prompt →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI-Powered Developer: Build software with ChatGPT and Copilot. The section links point to the parts of the book it draws on.