feat(feedback): Add content improvement feedback system

Frontend (frontend/app.js):

- Add textarea for improvement feedback

- Add submit button with loading state

- Handle API response and display improved content

Backend (backend/copywriter.py):

- Add improve_copy() method using Cohere API

- Integrate retry mechanism for API calls

Backend (backend/main.py):

- Add /improve-content POST endpoint

- Implement error handling and return improved content with metadata

Testing:

- Verified feedback submission flow

- Confirmed improved content generation

- Tested error scenarios and loading states
This commit is contained in:
Michael Ikehi
2025-04-18 17:57:35 +01:00
parent cc2b230f62
commit 12e0830ba6
11 changed files with 277 additions and 61 deletions
+3 -3
View File
@@ -48,7 +48,7 @@
<div class="generation-form">
<div class="form-group">
<label for="prompt">What would you like to create?</label>
<textarea id="prompt" placeholder="e.g., Write a social media post for our new coaching program launch" rows="4"></textarea>
<textarea id="prompt" placeholder="e.g., Generate an email campaign for a product launch" rows="4"></textarea>
</div>
<div class="form-row">
@@ -84,12 +84,12 @@
<div class="form-group checkbox-group">
<label class="checkbox">
<input type="checkbox" id="include-cta" checked>
<input type="checkbox" id="include-cta" unchecked>
<span class="checkmark"></span>
Include Call to Action
</label>
<label class="checkbox">
<input type="checkbox" id="reference-similar" checked>
<input type="checkbox" id="reference-similar" unchecked>
<span class="checkmark"></span>
Reference Similar Content
</label>