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 04:42:26 +01:00
parent af8f99dea3
commit cc2b230f62
12 changed files with 178 additions and 2 deletions
@@ -0,0 +1,16 @@
{
"content": "Transform Your Business Reality\n\nYou already have everything you need to create extraordinary success. This proven business transformation program gives you the exact framework to unlock your full potential.\n\nWhat you'll master:\n• Make confident, strategic decisions that drive growth\n• Break through limiting patterns that hold you back\n• Create systems that generate consistent results\n• Lead with unshakeable confidence\n\nStop waiting for the perfect moment. Your time is now. Take the first step toward transformational change - schedule your strategy session today.",
"content_type": "website_copy",
"metadata": {
"campaign_name": "Business Transformation Program",
"performance_metrics": {
"conversion_rate": 0.18,
"bounce_rate": 0.25,
"avg_time_on_page": 185
},
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 1,
"timestamp": "2024-01-01T00:00:00Z"
}