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
+17
View File
@@ -0,0 +1,17 @@
{
"content": "Headline: Transform Your Business in 90 Days\n\nAd Text: Ready for breakthrough results? The Business Evolution Program gives you the exact framework for sustainable success. 15 spots only. Includes private mentoring + proven systems.\n\nButton: Get Your Strategy Plan\n\nHeadline 2: Stop Playing Small. Start Leading.\n\nAd Text 2: Join successful entrepreneurs who've transformed their businesses. Our proven framework creates predictable growth. Limited spots for Q1 2024.\n\nButton 2: Book Your Call Now",
"content_type": "ad_copy",
"metadata": {
"campaign_name": "Q1 2024 Program Ads",
"performance_metrics": {
"click_through_rate": 0.085,
"cost_per_click": 4.25,
"conversion_rate": 0.06
},
"platform": "Meta Ads",
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 6,
"timestamp": "2024-01-01T00:00:00Z"
}