Skip to content

Commit 486b2b1

Browse files
authored
fix: add dynamic greeting variations to make Jarvis feel more natural (#347)
- Created GetRandomWelcomeMessage function in greeting.py with 10 different greeting variations - Updated auth.py to use random greetings instead of static message - Includes original greeting message plus 9 new variations - All changes pass ruff linting checks Closes #327
1 parent 2f408c8 commit 486b2b1

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/apps/auth/auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytz
55
import streamlit as st
66

7-
from src.utils.greeting import GreetUser
7+
from src.utils.greeting import GetRandomWelcomeMessage, GreetUser
88

99

1010
def unix_to_ist(timestamp):
@@ -22,7 +22,7 @@ def auth():
2222

2323
else:
2424
st.title(f"🙏 {GreetUser(st.user.given_name)}")
25-
st.success("Welcome to Jarvis AI Assistant!", icon="🤝")
25+
st.success(GetRandomWelcomeMessage(), icon="🤝")
2626
st.image(st.user.picture, caption=st.user.name)
2727
st.write("Email:", st.user.email)
2828

src/utils/greeting.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import random
12
from datetime import datetime
23

34
import pytz
@@ -13,3 +14,20 @@ def GreetUser(name):
1314
elif 17 <= hour < 21:
1415
return f"Good Evening, {name}"
1516
return f"Good Night, {name}"
17+
18+
19+
def GetRandomWelcomeMessage():
20+
"""Returns a random welcome message to make Jarvis feel more dynamic and natural."""
21+
welcome_messages = [
22+
"I am Jarvis Sir. Please tell me how may I help you.",
23+
"Ready to assist you with anything you need!",
24+
"At your service! What can I do for you today?",
25+
"Hello! I'm here to make your day easier.",
26+
"Great to see you! How can I assist you?",
27+
"I'm all set to help you out. What's on your mind?",
28+
"Standing by to help with whatever you need!",
29+
"Your AI assistant is ready. What would you like to do?",
30+
"Here to help! Just let me know what you need.",
31+
"Ready and waiting to assist you today!",
32+
]
33+
return random.choice(welcome_messages)

0 commit comments

Comments
 (0)