update categories to add Buzz

This commit is contained in:
2025-05-12 19:40:00 +10:00
parent 37f9fdcc44
commit 692811190e
2 changed files with 4 additions and 5 deletions
+3 -3
View File
@@ -663,7 +663,7 @@ def generate_category_from_summary(summary):
model=LIGHT_TASK_MODEL,
messages=[
{"role": "system", "content": (
"Based on this summary, select the most relevant category from: Food, Culture, Trends, Health, Lifestyle, Drink, Eats. "
"Based on this summary, select the most relevant category from: Buzz, Trends, Lifestyle, Culture, Health, Drink, Food, Eats. "
"Return only the category name."
)},
{"role": "user", "content": summary}
@@ -672,7 +672,7 @@ def generate_category_from_summary(summary):
)
category = response.choices[0].message.content.strip()
logging.info(f"Generated category: {category}")
return category if category in ["Food", "Culture", "Trends", "Health", "Lifestyle", "Drink", "Eats"] else "Trends"
return category if category in ["Buzz", "Trends", "Lifestyle", "Culture", "Health", "Drink", "Food", "Eats"] else "Trends"
except Exception as e:
logging.error(f"Category generation failed: {e}")
return "Trends"
@@ -1637,7 +1637,7 @@ def prepare_post_data(summary, title, main_topic=None):
# Select a full author dictionary from AUTHORS (already imported from foodie_config)
author = random.choice(AUTHORS)
categories = ["Food", "Trends", "Eats", "Culture"]
categories = ["Buzz", "Trends", "Lifestyle", "Culture", "Health", "Drink", "Food", "Eats"]
category = random.choice(categories)
post_data = {