Spaces:
Running
Running
import google.generativeai as genai | |
from .formulas import create_bullet_instruction | |
def generate_bullets(api_key, avatar_description, product_name, model_name="gemini-pro"): | |
""" | |
Generates benefit bullets for a product/service based on the target audience. | |
Args: | |
api_key: Google API key for Gemini | |
avatar_description: Description of the target audience | |
product_name: Name of the product or service | |
model_name: Name of the model to use | |
Returns: | |
str: Generated bullets | |
""" | |
# Configure the API | |
genai.configure(api_key=api_key) | |
# Get the model | |
model = genai.GenerativeModel(model_name) | |
# Create the instruction | |
instruction = create_bullet_instruction(avatar_description, product_name) | |
# Generate the bullets | |
response = model.generate_content(instruction) | |
return response.text |