diff --git a/src/config.py b/src/config.py index 24abac5..b81e5d9 100644 --- a/src/config.py +++ b/src/config.py @@ -73,12 +73,16 @@ class Config: THREAD_ID = "4" MAX_TOKENS_HISTORY = 10000 + # Personalization — customize the assistant's identity + ASSISTANT_NAME = os.environ.get("ASSISTANT_NAME", "Jasper") + # Whisper Configuration TRANSCRIPTION_MODEL = "distil-whisper-large-v3-en" TRANSCRIPTION_PROMPT = ( "Please transcribe the following audio accurately, maintaining proper " "punctuation and formatting. This is a conversation between a user and " - "a Desktop Assistant named \"Jasper\". So, focus on words like 'Jasper'." + f'a Desktop Assistant named "{ASSISTANT_NAME}". ' + f"So, focus on words like '{ASSISTANT_NAME}'." ) # ADB Configuration @@ -89,8 +93,6 @@ class Config: MOBILE_HOST = os.environ.get("MOBILE_HOST") MOBILE_PORT = int(os.environ.get("MOBILE_PORT", "5555")) - # Personalization — customize the assistant's identity - ASSISTANT_NAME = os.environ.get("ASSISTANT_NAME", "Jasper") OWNER_NAME = os.environ.get("OWNER_NAME", "User") OWNER_AGE = os.environ.get("OWNER_AGE", "") OWNER_LOCATION = os.environ.get("OWNER_LOCATION", "") diff --git a/src/ui/overlay.py b/src/ui/overlay.py index 99a4f9c..9689124 100644 --- a/src/ui/overlay.py +++ b/src/ui/overlay.py @@ -53,7 +53,7 @@ def __init__(self, message_timeout=5, exit_callback=None): def setup_ui(self): """Set up the user interface.""" # Main window configuration - self.setWindowTitle("Jasper Assistant") + self.setWindowTitle(f"{config.ASSISTANT_NAME} Assistant") self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint) self.setAttribute(Qt.WA_TranslucentBackground) self.setGeometry( @@ -210,14 +210,14 @@ def process_messages(self): elif msg_type == "response": text = args[0] - self.add_log_message(f"Jasper: {text}", "#00FF00") # Green + self.add_log_message(f"{config.ASSISTANT_NAME}: {text}", "#00FF00") # Green except Exception as e: logger.error(f"Error processing message: {e}") def start(self): """Start the overlay.""" - self.update_status("Jasper Active", "lightgreen") + self.update_status(f"{config.ASSISTANT_NAME} Active", "lightgreen") def shutdown(self): """Shut down the overlay.""" @@ -241,7 +241,7 @@ def main(): # Demo updating QTimer.singleShot(1000, lambda: overlay.update_status("Listening", "lightblue")) - QTimer.singleShot(2000, lambda: overlay.add_log_message("Jasper, what's the weather today?")) + QTimer.singleShot(2000, lambda: overlay.add_log_message(f"{config.ASSISTANT_NAME}, what's the weather today?")) QTimer.singleShot(3000, lambda: overlay.update_status("Processing", "yellow")) QTimer.singleShot(4000, lambda: overlay.update_status("Responding", "lightgreen")) QTimer.singleShot(