|
|
|
@ -663,7 +663,7 @@ def generate_category_from_summary(summary): |
|
|
|
model=LIGHT_TASK_MODEL, |
|
|
|
model=LIGHT_TASK_MODEL, |
|
|
|
messages=[ |
|
|
|
messages=[ |
|
|
|
{"role": "system", "content": ( |
|
|
|
{"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." |
|
|
|
"Return only the category name." |
|
|
|
)}, |
|
|
|
)}, |
|
|
|
{"role": "user", "content": summary} |
|
|
|
{"role": "user", "content": summary} |
|
|
|
@ -672,7 +672,7 @@ def generate_category_from_summary(summary): |
|
|
|
) |
|
|
|
) |
|
|
|
category = response.choices[0].message.content.strip() |
|
|
|
category = response.choices[0].message.content.strip() |
|
|
|
logging.info(f"Generated category: {category}") |
|
|
|
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: |
|
|
|
except Exception as e: |
|
|
|
logging.error(f"Category generation failed: {e}") |
|
|
|
logging.error(f"Category generation failed: {e}") |
|
|
|
return "Trends" |
|
|
|
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) |
|
|
|
# Select a full author dictionary from AUTHORS (already imported from foodie_config) |
|
|
|
author = random.choice(AUTHORS) |
|
|
|
author = random.choice(AUTHORS) |
|
|
|
|
|
|
|
|
|
|
|
categories = ["Food", "Trends", "Eats", "Culture"] |
|
|
|
categories = ["Buzz", "Trends", "Lifestyle", "Culture", "Health", "Drink", "Food", "Eats"] |
|
|
|
category = random.choice(categories) |
|
|
|
category = random.choice(categories) |
|
|
|
|
|
|
|
|
|
|
|
post_data = { |
|
|
|
post_data = { |
|
|
|
|