File size: 929 Bytes
6717c52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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