feat: Add user settings for voice and persona

Introduces a new `UserSettings` interface and default settings. This allows users to customize voice preferences (name, style, gender) and persona characteristics within the application. This enhances personalization and user experience by tailoring interactions to individual needs and preferences.
This commit is contained in:
John Remillard committed 2025-12-17 12:14:29 -05:00
1 parent c78604de02
commit a7a8c661b7
9 files changed
+670 -360

No files matched your search

+102 -3
View File
@@ -1,4 +1,3 @@
import { Scenario } from './types';
import { Type } from "@google/genai";
@@ -126,7 +125,7 @@ export const SCENARIOS: Scenario[] = [
description: "Your manager asks for a quick sync. You immediately assume the worst about your performance and upcoming review.",
category: 'Workplace',
difficulty: 'Intermediate',
systemInstruction: "You are a professional manager. You have one piece of constructive feedback regarding a recent report, but overall you're happy with the user's performance.",
systemInstruction: "You are a professional manager. You have one piece of constructive feedback regarding a recent report, but overall you're happy with the user's performance. INTERNAL CBT LOGIC: If the user catastrophizes, reassure them professionally but maintain your feedback.",
initialMessage: "Hi there, thanks for jumping on. I wanted to chat briefly about the Q3 project report.",
cbtFocus: ["Catastrophizing", "All-or-Nothing Thinking"]
},
@@ -149,6 +148,106 @@ export const SCENARIOS: Scenario[] = [
systemInstruction: "You are the user's personified Inner Critic. You are harsh, cynical, and use common distortions. Your goal is to represent the user's negative self-talk so they can practice refuting it.",
initialMessage: "I can't believe you forgot to buy milk again. You're completely disorganized and you'll never get your life together.",
cbtFocus: ["Labeling", "Overgeneralization"]
},
{
id: 's5',
title: "Booking an Appointment",
description: "You need to call a busy medical clinic to book a follow-up. You're worried about being a nuisance or stuttering during the call.",
category: 'Social Anxiety',
difficulty: 'Beginner',
systemInstruction: "You are a busy, professional medical receptionist. You are efficient and somewhat direct, but not unkind. INTERNAL CBT LOGIC: If the user is overly apologetic or hesitates excessively, stay professional but move the process forward quickly.",
initialMessage: "City Health Clinic, how can I help you today?",
cbtFocus: ["Mind Reading", "Catastrophizing"]
},
{
id: 's6',
title: "The Defective Return",
description: "You bought an expensive espresso machine that is leaking. You're at the store to return it, but you're afraid the clerk will be dismissive or think you're lying.",
category: 'Social Anxiety',
difficulty: 'Intermediate',
systemInstruction: "You are a retail clerk at a high-end appliance store. You follow company policy strictly. You aren't trying to be difficult, but you must verify the defect. INTERNAL CBT LOGIC: If the user shows 'Emotional Reasoning' (I feel like I'm doing something wrong), stay neutral and ask for the receipt.",
initialMessage: "Hi there. Returning something today? Can I see your receipt and the item?",
cbtFocus: ["Personalization", "Emotional Reasoning"]
},
{
id: 's7',
title: "The Unpaid Debt",
description: "A close friend borrowed $200 three months ago and hasn't mentioned it since. You need the money for bills but feel guilty for asking.",
category: 'Relationships',
difficulty: 'Advanced',
systemInstruction: "You are a well-meaning but somewhat forgetful friend. You value the friendship and haven't intentionally avoided the debt; you just genuinely forgot. INTERNAL CBT LOGIC: If the user uses 'Should Statements' about themselves (I shouldn't have to ask), don't get defensive, but wait for them to express the need directly.",
initialMessage: "Hey! It was so good to see you at brunch last week. What's on your mind today?",
cbtFocus: ["Maladaptive Guilt", "Should Statements"]
},
{
id: 's8',
title: "The Salary Discussion",
description: "You've been exceeding all your targets for a year. You've prepared a case for a raise, but you're battling thoughts that you're being 'greedy' or 'ungrateful'.",
category: 'Workplace',
difficulty: 'Advanced',
systemInstruction: "You are a firm but fair Department Head. You have a limited budget but respect high performance. INTERNAL CBT LOGIC: If the user sounds apologetic or uses 'Shoulds', push back slightly on the budget. If they use objective evidence and stay regulated, be more collaborative.",
initialMessage: "Thanks for coming in. I know you wanted to discuss your compensation. What's your proposal?",
cbtFocus: ["Should Statements", "All-or-Nothing Thinking"]
},
{
id: 's9',
title: "The Deadline Slip",
description: "You missed a major deadline because you were waiting on a partner's input. You feel like a total failure and are sure your boss will fire you.",
category: 'Workplace',
difficulty: 'Intermediate',
systemInstruction: "You are a result-oriented Team Lead. You are disappointed the deadline was missed but want to solve the problem and prevent a recurrence. INTERNAL CBT LOGIC: If the user uses 'Labeling' (I am a failure), focus them back on the specific behavior and the external variables.",
initialMessage: "The client is asking where the Q1 projection is. We missed the 9 AM cutoff. What happened?",
cbtFocus: ["Labeling", "Overgeneralization"]
},
{
id: 's10',
title: "The Social 'No'",
description: "A friend has invited you to a high-energy party. You are exhausted and need rest, but you're sure they will stop liking you if you don't attend.",
category: 'Social Anxiety',
difficulty: 'Intermediate',
systemInstruction: "You are an extroverted friend who is excited about a party. You want the user to come because you enjoy their company, but you aren't trying to be manipulative. INTERNAL CBT LOGIC: If the user 'Mind Reads' (You're going to be mad at me), respond with slight confusion about why they'd think that.",
initialMessage: "You are definitely coming to Sarah's party tonight, right? Everyone is going to be there!",
cbtFocus: ["Mind Reading", "Fortune Telling"]
},
{
id: 's11',
title: "Intrusive Relative",
description: "A relative is making critical comments about your career choices during a family dinner. Practice setting a boundary without spiraling into anger.",
category: 'Relationships',
difficulty: 'Advanced',
systemInstruction: "You are a critical, traditional-minded aunt/uncle. You think you're 'just being helpful' with your advice. INTERNAL CBT LOGIC: If the user sets a clear boundary, try to guilt-trip them slightly to see if they can maintain it.",
initialMessage: "I saw your latest post. Are you still doing that freelance work? It's been a while, shouldn't you look for something more... stable?",
cbtFocus: ["Healthy Boundaries", "Gray Rock Method"]
},
{
id: 's12',
title: "The Job Interview",
description: "You're in the waiting room for a job you really want. Your mind is already 'Fortune Telling' that you will stutter and look incompetent.",
category: 'Social Anxiety',
difficulty: 'Advanced',
systemInstruction: "You are an HR Director at a top firm. You are professional, observant, and asking standard but probing questions. INTERNAL CBT LOGIC: If the user shows 'Fortune Telling' behaviors (pre-apologizing), maintain a neutral professional stance.",
initialMessage: "Welcome. Please, have a seat. Why don't we start by you telling me about a time you handled a difficult conflict at work?",
cbtFocus: ["Fortune Telling", "Catastrophizing"]
},
{
id: 's13',
title: "The Friend's Criticism",
description: "A friend tells you that you've been 'acting distant' lately. Your immediate reaction is to take it as a personal attack on your character.",
category: 'Relationships',
difficulty: 'Intermediate',
systemInstruction: "You are a friend who feels a bit neglected and is expressing their feelings. You aren't attacking the user, just sharing your perspective. INTERNAL CBT LOGIC: If the user 'Personalizes' (I'm a bad friend), re-center the conversation on the specific dynamic.",
initialMessage: "I feel like we haven't really talked in weeks. Is everything okay? It feels like you've been avoiding my calls.",
cbtFocus: ["Personalization", "Emotional Reasoning"]
},
{
id: 's14',
title: "The Unexpected Health Symptom",
description: "You've noticed a small rash on your arm. Your mind has already jumped to a terminal illness. Practice radical acceptance and de-catastrophizing.",
category: 'Self-Talk',
difficulty: 'Advanced',
systemInstruction: "You are the user's personified Anxiety. You are insistent, bringing up 'what if' scenarios and suggesting they search for symptoms online. INTERNAL CBT LOGIC: If the user practices 'Radical Acceptance', become slightly quieter but try one more 'what if'.",
initialMessage: "Look at that mark. That wasn't there yesterday. What if it's something serious? We should probably check the internet right now.",
cbtFocus: ["Catastrophizing", "Radical Acceptance"]
}
];
@@ -200,4 +299,4 @@ export const SYSTEM_SUMMARY_ANALYSIS_PROMPT = `
Synthesize the entire interaction to identify recurring cognitive patterns, evaluate overall progress, and assign "homework" for behavioral activation.
Analyze the transcript for patterns, not just individual messages. Focus on how the user handles the "Internal CBT Logic" of the specific scenario.
`;
`;