Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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", "")
Expand Down
8 changes: 4 additions & 4 deletions src/ui/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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."""
Expand All @@ -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(
Expand Down
Loading