import openai def product_review(product_name, product_notes): openai.api_key = 'YOUR_OPENAI_API_KEY' # Replace with your actual OpenAI API key prompt = f"Generate a product review for the {product_name}:\n\nProduct Notes:\n{product_notes}\n\nReview:" response = openai.Completion.create( engine="text-davinci-003", # You can use other engines like gpt-3.5-turbo or gpt-4 prompt=prompt, max_tokens=500 # Adjust the length as needed ) review = response.choices[0].text.strip() # HTML formatting html_content = f""" <html> <head> <title>{product_name} Review</title> </head> <body>

{product_name} Review

{review}

</body> </html> """ return html_content