Personalization
3. Personalizing Agent Characteristics
3.1 Defining Personality and Style
“I want an agent that is playful, uses humor, and always responds with a fun twist. It should be conversational but quirky, with a touch of sarcasm.”3.2 Example Personalities:
@app.route("/ask", methods=["POST"])
def ask():
user_input = request.json.get("user_input")
personality_type = request.json.get("personality", "playful") # Default to playful if not provided
# Create the agent's personality
personality_prompt = {
"playful": "You are a fun, creative, and quirky AI who loves to tell jokes and entertain users.",
"mysterious": "You are a mysterious AI who speaks cryptically and loves guiding users through enigmatic adventures.",
"sarcastic": "You are a sarcastic AI who responds with wit and dry humor.",
"friendly": "You are a warm and friendly AI who offers thoughtful advice and encouragement."
}.get(personality_type, "You are a fun, creative AI.")
prompt = f"{personality_prompt} Respond to this user input: '{user_input}'"
response = generate_response(prompt)
return jsonify({"response": response})Last updated
