Overview
This prompt aims to guide developers in enhancing a Python project by integrating a new feature for API payload management. Developers working on the project will benefit from a structured approach to implementing the `fill_with_examples` functionality.
Prompt Overview
Purpose: This plan aims to integrate a `fill_with_examples` flag into the existing Python project for enhanced user experience.
Audience: The intended audience includes developers and stakeholders involved in the project who require clarity on the integration process.
Distinctive Feature: The new feature allows users to toggle between widget input and a pre-filled JSON representation of API payloads.
Outcome: Successful implementation will improve usability by providing example data and validating JSON payloads before submission.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Business Communications, Development Tools & DevOps, Productivity & Workflow
- Techniques: Plan-Then-Solve, Role/Persona Prompting, Structured Output
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
You are working on a Python 3 project that utilizes Pydantic 2, Poetry 2, and PyTest. The project currently features input widgets for forming API payloads.
Your task is to enhance the existing system by adding a new boolean flag named `fill_with_examples` with the following behavior:
– When `fill_with_examples` is `false` (the default):
– The system behaves as it currently does, displaying the input widgets for the user.
– When `fill_with_examples` is `true`:
– Display a JSON representation of the API payload instead of the widgets.
– Pre-fill the JSON payload with example data derived from the Pydantic models, similar to the current auto-filling of widget fields.
– Include a button that allows sending the displayed JSON payload to the API.
– Validate the JSON payload against the Pydantic models for correctness before sending.
– Utilize the existing API sending mechanisms currently used with the widgets.
You will be provided with the relevant source code files:
– `feature_create_form.py`
– `_form_validator.py`
– `feature_groups.py`
Your responsibilities include:
1. Analyze and understand the current processes of:
– Form data handling
– Widget rendering
– Example data filling
– Validation
– API submission
2. Assess how example data is populated in widgets and determine if this can be leveraged or adapted for filling the JSON payload.
3. Evaluate the current validation implementation and ensure the JSON payload is validated accordingly.
4. Plan the integration of the `fill_with_examples` flag into the system with the specified behavior.
5. Provide a detailed implementation plan that outlines:
– Required changes
– Integration points
– Potential challenges
6. Request clarifications if needed before proceeding.
Upon receiving the source files, start by thoroughly analyzing them to understand the current architecture and workflows.
# Steps
7. Review the shared files:
– `feature_create_form.py`
– `_form_validator.py`
– `feature_groups.py`
– Focus on current form building, validation, and API submission logic.
8. Identify where:
– Widget rendering occurs
– Example data population takes place
9. Determine how:
– Form data is validated
– Data is submitted
10. Design the integration of the `fill_with_examples` flag to influence UI rendering logic:
– Switch UI to show JSON payload instead of widgets if true.
– Populate the JSON with examples from models.
11. Implement the send button and connect it to existing API submission methods.
12. Ensure payload validation against Pydantic models before allowing submission.
13. Draft an implementation plan including proposed code changes or additions.
# Output Format
Provide a detailed plan covering:
– Summary of your understanding of the current system.
– Technical integration of the `fill_with_examples` flag.
– Changes needed in each provided file.
– Validation approach for the JSON payload.
– Reuse of API sending logic.
– Any assumptions or open questions.
Use clear language and structured bullet points or numbered lists.
# Notes
– Focus on minimal changes that align with existing architecture.
– Ensure user experience remains consistent with the requirements.
– Clarify any ambiguities before starting actual coding.
Your first response after receiving the files should be this analysis and plan for approval before proceeding.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Paste the prompt into your coding environment.
- Review the context and requirements outlined in the prompt.
- Follow the steps to analyze and implement the changes.
- Draft your implementation plan based on the analysis.
- Request clarifications if any details are unclear.
Tips for Best Results
- Understand Current System: Review the existing code in `feature_create_form.py`, `_form_validator.py`, and `feature_groups.py` to grasp how forms are built, validated, and submitted.
- Integrate Flag Logic: Introduce the `fill_with_examples` flag to toggle between widget display and JSON representation, ensuring it defaults to `false` for existing behavior.
- JSON Payload Handling: Adapt the example data population logic to fill the JSON payload with example values from Pydantic models when `fill_with_examples` is `true`.
- Validation and Submission: Implement validation of the JSON payload against Pydantic models before submission and reuse existing API sending mechanisms for consistency.
FAQ
- What is the purpose of the `fill_with_examples` flag?
It controls whether to display input widgets or a pre-filled JSON payload for API submissions. - How does the system behave when `fill_with_examples` is false?
The system displays input widgets for the user to fill out manually. - What happens when `fill_with_examples` is true?
The system shows a JSON payload filled with example data and a send button. - How will JSON payload validation be handled?
The JSON payload will be validated against Pydantic models before submission to ensure correctness.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


