liveBook · Manning

Flipped interaction pattern

As explained in Learn AI-Assisted Python Programming, Second Edition

A flipped interaction pattern is a prompt pattern in which the language model asks the user questions instead of only answering the user's questions.

A flipped interaction pattern asks the language model to question the user instead of merely answering. It helps when the user does not know which information the model needs to complete a task. section 12.1.1 section 12.4

Designing password validation

Prompt Copilot Chat: “I would like a Python function that keeps asking the user for a password until they provide a strong password. Ask me questions one at a time until you can write that function.” If it asks several questions at once, restate the one-at-a-time requirement. The answers can guide a function that checks uppercase letters, numbers, and punctuation. section 12.1.1

How Learn AI-Assisted Python Programming, Second Edition covers it

How deep it goes
Defines the prompt structure and demonstrates correction after the model violates the one-question-at-a-time instruction.
Examples
Uses a password-strength function requiring uppercase characters, numbers, and punctuation as its worked example.
What you can do after
Apply it via Copilot Chat to elicit requirements before requesting a Python implementation.
How it connects
Connects prompt patterns with requirements gathering, language models, and persona patterns.

Related concepts

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