liveBook · Manning

Feedback integration

As explained in Coding with AI

Feedback integration is the incorporation of quality or correctness feedback into a subsequent version of an output or implementation.

Feedback integration refines an existing generated output by applying specific evaluation results instead of relying on a single one-shot prompt. For API request code, feedback can improve initialization, response handling, error handling, readability, maintainability, and edge-case coverage. section 9.5.1

Apply feedback as targeted revisions:

  • Add connection pooling and timeouts to HTTP GET initialization. section 9.5.1
  • Revise response handling to support both JSON and text responses. section 9.5.1
  • Handle HTTP 5xx errors with clear, actionable logging. section 9.5.1

Refining an API request

After evaluating generated code, prompt: “Given the feedback that the current response handling is too simplistic, revise the code to handle both JSON and text responses more effectively.” Continue with feedback on performance, comments, maintainability, and edge cases. section 9.5.1

Figure 9.6 A chain-of-thought prompt gets the model to reason out a problem like a human would. You break down the problem and experiment with answers until you get the results you desire.
A diagram of a diagram

Description automatically generated

Use the chain-of-thought workflow to break down the problem, test answers, and iteratively approach the desired result. section 9.5.1

How Coding with AI covers it

How deep it goes
Provides concrete revision prompts for initialization, response handling, errors, performance, readability, and edge cases.
Examples
Demonstrates revisions for JSON or text responses, HTTP 5xx errors, connection pooling, timeouts, comments, and maintainability.
What it assumes
Assumes an existing generated API implementation and feedback from evaluating its correctness, coverage, or quality.
What you can do after
Apply it via ChatGPT, Claude, or Blackbox AI to iteratively improve generated API code.
How it connects
Connects chain-of-thought prompting with API requests, response handling, error handling, timeouts, and connection pooling.

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.