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": "Subject: [Time-Sensitive] Transform Your Business in Q1 2024\n\nDear [Name],\n\nI hope this finds you ready for transformation.\n\nHere's what I know about successful entrepreneurs like you: You've already achieved what many consider 'success.' But you know there's another level waiting.\n\nThat's why I'm reaching out.\n\nThe Business Evolution Program opens for Q1 2024 next week. Only 15 spots available.\n\nWhat's New This Quarter:\n\n1. Enhanced Strategic Clarity Blueprint\n - Deeper business assessment\n - More precise action steps\n\n2. Expanded Implementation Support\n - Additional mentoring sessions\n - New implementation workshops\n\n3. Updated Growth Tools Suite\n - Latest revenue optimization systems\n - Advanced team protocols\n\nEarly Decision Bonus (48 Hours Only):\nVIP Strategy Day ($2,000 value)\n\nWhat Past Participants Say:\n\"Revenue up 127% in 90 days while working less.\" - Sarah T.\n\"Finally have clear systems and confident decision-making.\" - Michael R.\n\nReady to transform?\nBook your strategy session here → [Link]\n\nTo your success,\n[Name]\n\nP.S. Early Decision Bonus expires in 48 hours. Don't miss out.",
"content_type": "newsletter",
"metadata": {
"campaign_name": "Q1 Program Newsletter",
"performance_metrics": {
"open_rate": 0.45,
"click_rate": 0.18,
"conversion_rate": 0.08
},
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 12,
"timestamp": "2024-01-01T00:00:00Z"
}