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:39:06 +01:00
parent 6fd7213076
commit af8f99dea3
13 changed files with 550 additions and 167 deletions
+1 -3
View File
@@ -15,7 +15,6 @@ Generates marketing copy based on the provided prompt and optional parameters.
{
"prompt": "Write a social media post for our new product launch",
"content_type": "social_media",
"tone": "excited",
"length": "medium",
"include_cta": true
}
@@ -24,7 +23,6 @@ Generates marketing copy based on the provided prompt and optional parameters.
**Parameters**:
- `prompt` (string, required): The main instruction for generating content
- `content_type` (string, optional): Type of content to generate (social_media, email, blog, website, etc.)
- `tone` (string, optional): Desired tone (excited, professional, casual, etc.)
- `length` (string, optional): Content length (short, medium, long)
- `include_cta` (boolean, optional): Whether to include a call to action
@@ -184,4 +182,4 @@ Error response format:
"message": "Detailed error message",
"error_code": "ERROR_CODE"
}
```
```