Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def generate_personalized_categories(user_data):
- prompt = f"""
- Generate 5 personalized streaming category names and descriptions for a user with the following viewing history and preferences:
- Recently watched: {', '.join(user_data['recently_watched'])}
- Favorite genres: {', '.join(user_data['favorite_genres'])}
- Mood: {user_data['current_mood']}
- For each category, provide:
- 1. A catchy, personalized category name
- 2. A brief, engaging description of the category
- Ensure the categories and descriptions are tailored to the user's tastes and current mood.
- """
- response = llm.generate(prompt)
- return response.text
- # Example usage
- user = {
- "recently_watched": ["Stranger Things", "The Crown", "Black Mirror"],
- "favorite_genres": ["sci-fi", "drama", "thriller"],
- "current_mood": "looking for something thought-provoking"
- }
- personalized_categories = generate_personalized_categories(user)
- print(personalized_categories)
Advertisement
Add Comment
Please, Sign In to add comment