From f11da40f8632f4d913590b81e8d61c32d5a8de63 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 27 Oct 2025 17:19:32 +0530 Subject: [PATCH] fix: add dynamic greeting variations to make Jarvis feel more natural - 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 --- src/apps/auth/auth.py | 4 ++-- src/utils/greeting.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/apps/auth/auth.py b/src/apps/auth/auth.py index 3586aa42..2ca50c27 100644 --- a/src/apps/auth/auth.py +++ b/src/apps/auth/auth.py @@ -4,7 +4,7 @@ import pytz import streamlit as st -from src.utils.greeting import GreetUser +from src.utils.greeting import GetRandomWelcomeMessage, GreetUser def unix_to_ist(timestamp): @@ -22,7 +22,7 @@ def auth(): else: st.title(f"🙏 {GreetUser(st.user.given_name)}") - st.success("Welcome to Jarvis AI Assistant!", icon="🤝") + st.success(GetRandomWelcomeMessage(), icon="🤝") st.image(st.user.picture, caption=st.user.name) st.write("Email:", st.user.email) diff --git a/src/utils/greeting.py b/src/utils/greeting.py index c3898693..50f3cbf8 100644 --- a/src/utils/greeting.py +++ b/src/utils/greeting.py @@ -1,3 +1,4 @@ +import random from datetime import datetime import pytz @@ -13,3 +14,20 @@ def GreetUser(name): elif 17 <= hour < 21: return f"Good Evening, {name}" return f"Good Night, {name}" + + +def GetRandomWelcomeMessage(): + """Returns a random welcome message to make Jarvis feel more dynamic and natural.""" + welcome_messages = [ + "I am Jarvis Sir. Please tell me how may I help you.", + "Ready to assist you with anything you need!", + "At your service! What can I do for you today?", + "Hello! I'm here to make your day easier.", + "Great to see you! How can I assist you?", + "I'm all set to help you out. What's on your mind?", + "Standing by to help with whatever you need!", + "Your AI assistant is ready. What would you like to do?", + "Here to help! Just let me know what you need.", + "Ready and waiting to assist you today!", + ] + return random.choice(welcome_messages)