Update file paths in BrandStyleManager to use absolute paths for loading JSON data. Refactor MarketingCopywriter to streamline the generate_copy method by removing unused parameters and initialize dependencies in the generate_marketing_copy function. Modify main.py to remove unnecessary campaign prompt management. Update sample campaigns in campaigns.json for a TV company marketing campaign.

This commit is contained in:
boladeE
2025-04-18 22:34:15 +01:00
parent 4ac80ad73d
commit 3c0dd1d972
4 changed files with 15 additions and 11 deletions
-2
View File
@@ -11,7 +11,6 @@ import datetime
app = Flask(__name__)
# Initialize brand style manager
brand_style_manager = BrandStyleManager()
data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "data"))
campaign_prompt = []
@@ -35,7 +34,6 @@ def root():
global prompt
if request.method == 'POST':
prompt = request.form.get('prompt')
campaign_prompt.pop()
campaign_prompt.append(prompt)
marketing_copy = generate_marketing_copy(prompt)
return render_template('index.html', generated_copy=marketing_copy)