Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def generate_personalized_description(product, customer_data):
- prompt = f"""
- Generate a product description for {product['name']} tailored for a customer with the following attributes:
- - Age: {customer_data['age']}
- - Interests: {', '.join(customer_data['interests'])}
- - Past purchases: {', '.join(customer_data['past_purchases'])}
- - Skill level: {customer_data['skill_level']}
- The description should highlight features that would appeal to this specific customer based on their profile.
- """
- response = llm.generate(prompt)
- return response.text
- # Example usage
- product = {
- "name": "AlpineX Hiking Boots",
- "features": ["waterproof", "lightweight", "durable"]
- }
- customer = {
- "age": 35,
- "interests": ["hiking", "photography"],
- "past_purchases": ["backpack", "trekking poles"],
- "skill_level": "intermediate"
- }
- personalized_description = generate_personalized_description(product, customer)
- print(personalized_description)
Advertisement
Add Comment
Please, Sign In to add comment