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:
+1
-3
@@ -8,7 +8,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
const generateBtn = document.getElementById('generate-btn');
|
||||
const promptInput = document.getElementById('prompt');
|
||||
const contentTypeSelect = document.getElementById('content-type');
|
||||
const toneSelect = document.getElementById('tone');
|
||||
const lengthSelect = document.getElementById('length');
|
||||
const includeCTACheckbox = document.getElementById('include-cta');
|
||||
const referenceSimilarCheckbox = document.getElementById('reference-similar');
|
||||
@@ -86,7 +85,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
const requestData = {
|
||||
prompt: promptInput.value,
|
||||
content_type: contentTypeSelect.value || null,
|
||||
tone: toneSelect.value || null,
|
||||
length: lengthSelect.value || null,
|
||||
include_cta: includeCTACheckbox.checked,
|
||||
reference_similar_content: referenceSimilarCheckbox.checked
|
||||
@@ -510,4 +508,4 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
// For demonstration purposes, let's create a mocked pre-filled content
|
||||
// In a real implementation, this would be loaded from the backend
|
||||
document.getElementById('prompt').value = 'Write a social media post about our new coaching program';
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user