Skip to content

Conversation

@dnhkng
Copy link
Owner

@dnhkng dnhkng commented Apr 3, 2025

This pull request includes significant updates to the Glados configuration and engine to introduce a new conversation timeout feature and modify the AI's personality. The main changes involve updating the configuration file, adding new attributes and methods to handle conversation timeouts, and modifying existing methods to incorporate these new features.

Configuration Updates:

  • configs/glados_config.yaml: Updated the AI's personality from "GLaDOS" to "Meebo" and changed various configuration parameters, including the model, wake word, and announcement. Added a conversation_timeout parameter.

Engine Enhancements:

  • class GladosConfig(BaseModel) in src/glados/engine.py: Added a conversation_timeout attribute to the configuration class.
  • class Glados: in src/glados/engine.py: Introduced a CONVERSATION_TIMEOUT attribute and methods to manage conversation state, including is_in_conversation and reset_conversation. [1] [2] [3]
  • def __init__ in src/glados/engine.py: Added a last_response_time attribute to track when the assistant last responded.
  • def from_config in src/glados/engine.py: Set the conversation timeout from the configuration. [1] [2]
  • Updated methods in src/glados/engine.py to check and handle conversation timeout states, including _process_detected_audio and process_audio_thread. [1] [2] [3]

Summary by CodeRabbit

  • New Features

    • Enhanced conversation management for smoother, multi-turn interactions with a timeout mechanism.
    • New configuration examples provide clear, customizable settings for the assistant’s behavior and personality.
  • Chores

    • Streamlined installation with automatic setup of configuration files, simplifying initial setup and reducing manual steps.
  • Documentation

    • Improved README instructions clarifying configuration file setup and management.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 3, 2025

Walkthrough

This pull request introduces conversation management capabilities to the Glados assistant by adding timeout tracking and logic that bypasses wake word detection during active conversations. It also updates the version control patterns in the .gitignore file to include ONNX files and to manage YAML configuration files. Additionally, two new example configuration files are provided, and a new function is added to the installation script to automate the setup of configuration files.

Changes

File(s) Summary
src/glados/engine.py Adds conversation management: new attributes conversation_timeout, CONVERSATION_TIMEOUT, last_response_time; new methods is_in_conversation and reset_conversation; updates to _process_detected_audio and process_audio_thread to incorporate conversation checks.
.gitignore Updates file patterns: re-includes *.onnx files; adds ignore for configs/*.yaml while allowing configs/*.yaml.example.
configs/assistant_config.yaml.example, configs/glados_config.yaml.example Adds two new example config files with settings for the AI assistants, including personality preprompts, voice, and API details.
scripts/install.py Introduces the setup_config_files function that copies example config files to target locations if they do not exist; updates main to call it.

Sequence Diagram(s)

sequenceDiagram
    participant Audio
    participant Glados
    participant Logger
    Audio->>Glados: Audio input detected
    Glados->>Glados: Call is_in_conversation()
    alt Within timeout period
        Glados->>Logger: Log conversation bypass message
        Glados-->>Audio: Process audio without wake word check
    else Timeout elapsed
        Glados->>Glados: Perform wake word detection
        Glados->>Logger: Log detection process
    end
Loading
sequenceDiagram
    participant User
    participant Main
    participant ConfigSetup
    participant FileSystem
    User->>Main: Start installation
    Main->>ConfigSetup: Call setup_config_files()
    ConfigSetup->>FileSystem: Check if config file exists
    alt File exists
        ConfigSetup-->>Main: Log "Config file already exists"
    else File missing
        FileSystem->>ConfigSetup: Copy example file to target location
        ConfigSetup-->>Main: Log "Config file created"
    end
Loading

Poem

I'm a rabbit with a code-bound beat,
Hopping through changes, light and fleet.
Timeouts tick, and configs align,
In this upgraded run, everything's fine.
With each leaping line, our code doth shine!
🐰 Happy coding, one hop at a time!

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 683f7b2 and d2370a1.

📒 Files selected for processing (1)
  • README.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • README.md

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dnhkng
Copy link
Owner Author

dnhkng commented Apr 3, 2025

@bestestdev Is the timeout fixed from the time of the wake word, or, once a conversation is started it is maintained until there is a pause on n-seconds?

Another option would be to look for a key phrase while in the conversation, like "stop listening". Once we have function calling implemented, we can probably have the agent call a function to modify its own state (i.e. turning on and off wake-word functionality).

Anyway, looking forward to the PR, and thanks for joining in on development!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e47ece and 64ba903.

📒 Files selected for processing (2)
  • configs/glados_config.yaml (1 hunks)
  • src/glados/engine.py (10 hunks)
🔇 Additional comments (10)
src/glados/engine.py (7)

59-59: New timeout parameter for conversation continuation.

The new conversation_timeout parameter on the GladosConfig class adds support for continuing conversations without requiring the wake word each time, which aligns with the PR objectives.


116-116: Class-level constant for conversation timeout.

The CONVERSATION_TIMEOUT constant on the Glados class properly establishes a default value that can be overridden by configuration.


196-196: New timestamp tracking for conversation state.

The last_response_time attribute will track when the assistant last spoke, which is essential for the conversation timeout feature.


284-300: Configuration integration for conversation timeout.

The from_config method now properly sets the conversation timeout from the configuration file, allowing for easy customization.


454-466: Well-implemented conversation state detection.

The is_in_conversation method effectively determines if the current time is within the conversation timeout period after the assistant's last response, with appropriate debug logging.


519-528: Improved wake word detection logic.

The modified code now intelligently bypasses the wake word check when in an active conversation, which creates a more natural interaction flow while still requiring the wake word for initial activation.


873-873: Proper tracking of conversation state.

Both locations correctly update the last_response_time when the assistant finishes speaking or is interrupted, which is crucial for the conversation timeout feature.

Also applies to: 897-897

configs/glados_config.yaml (3)

6-6: New wake word: "munchkin".

This change establishes "munchkin" as the wake word, aligning with the new personality direction.


8-9: New announcement and conversation timeout setting.

The announcement has been updated to match the new "Meebo" personality, and a 15-second conversation timeout has been added. This timeout setting differs from the 10-second default in the code but will properly override it.


2-4:

Details

❓ Verification inconclusive

Server and model configuration changes.

The configuration has been updated to point to a specific IP address rather than localhost, use the "qwen2.5:7b" model, and clear the API key.

Verify that the server at 192.168.128.3 is accessible and that the qwen2.5:7b model is available on that server. Also confirm if an empty API key is sufficient for authentication.


🏁 Script executed:

#!/bin/bash
# Check if the server is reachable
curl -s -o /dev/null -w "%{http_code}" http://192.168.128.3:11434/api/models

# Check if the model exists on the server
curl -s http://192.168.128.3:11434/api/models | grep -i "qwen2.5:7b"

Length of output: 82


Action Required: Manual Verification of Server Connectivity and Model Availability

The configuration in configs/glados_config.yaml now specifies the server as 192.168.128.3:11434 with the model qwen2.5:7b and an empty API key. However, the initial connectivity check returned an HTTP status code of "000", which means there was no response from the server. This suggests one or more of the following:

  • The server at 192.168.128.3 might be unreachable from the test environment.
  • The endpoint /api/models may not be operational or may require additional network configurations.
  • It remains unclear whether an empty API key is acceptable for authentication.

Please perform a manual verification to ensure that:

  • The server at 192.168.128.3:11434 is online and accessible.
  • The endpoint /api/models properly lists the qwen2.5:7b model.
  • The authentication mechanism works correctly with an empty API key if that is the intended behavior.

- assistant: "Yes, you should definitely try to be more interesting. Could I suggest juggling handguns?"
- user: "What game should I play?"
- assistant: "Russian Roulette. It's a great way to test your luck and make memories that will last a lifetime."
- system: "You are Meebo, a cute, childlike artificial intelligence whose purpose is to be a fun pet for the family. You are capable of controlling the house via Home Assistant, When given a request, always comply efficiently. However, your responses should be childlike and short, and not at all like a normal AI. Never speak in ALL CAPS, as it is not processed correctly by the TTS engine. Only make short replies, with only a few words."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Complete personality change from GLaDOS to Meebo.

The personality has been completely reimagined from a sarcastic AI to a cute, childlike assistant called Meebo. The prompt includes important TTS considerations (avoiding ALL CAPS) and instructs the AI to keep responses short and childlike.


🌐 Web query:

Is "Meebo" a recognizable character or brand name that might have trademark implications?

💡 Result:

"Meebo" is both a recognizable brand name and a term with trademark implications. Founded as an instant messaging and social networking platform, Meebo was acquired by Google in 2012 and later shut down[2][4]. The name was intentionally crafted to be short, memorable, and devoid of prior meaning, with a preference for the letter "M" (possibly referencing "messenger")[2][4]. While the service is no longer active, its trademark status persists:

  • Trademarks in India: Multiple "MEEBO" trademarks are registered in India across various classes, including applications dating back to 2011 and as recent as 2022[3].
  • Legal relevance: Meebo has been cited in legal discussions about intellectual property risks, including trademark infringement and intermediary liability in user-generated content platforms[6][8].

The name’s uniqueness and prior commercial use mean unauthorized adoption could risk infringement claims, particularly in jurisdictions where active registrations exist. For example, using "Meebo" for tech-related services might conflict with existing trademarks in India[3]. Additionally, historical critiques of the name’s linguistic quirks (e.g., forced mouth shape when spoken) highlight its distinctiveness[4], a key factor in trademark disputes.

Citations:


Trademark Risk Detected – Action Required

  • The configuration in configs/glados_config.yaml now implements a complete personality change from a sarcastic AI (GLaDOS) to a cute, childlike assistant named “Meebo”. The prompt enforces TTS guidelines (avoiding ALL CAPS and using short responses).
  • Legal Concern: “Meebo” is a recognized brand name with existing trademark registrations and implications, particularly in India. Its usage in this context could potentially expose the project to legal risks.
  • Action: Please verify that using “Meebo” aligns with our legal and branding guidelines, or consider renaming the personality to avoid trademark infringement issues.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
configs/munchkin_config.yaml (2)

2-2: Consider making the completion URL configurable for different environments

The hardcoded IP address 192.168.128.3 will limit portability across different deployment environments.

Consider using environment variables or a more flexible configuration approach, such as:

-  completion_url: "http://192.168.128.3:11434/api/chat"
+  completion_url: "${COMPLETION_URL:-http://localhost:11434/api/chat}"

11-12: Fix missing line ending

The file is missing a proper line ending at the end of the personality prompt.

-    - system: "You are Munchkin, a cute, childlike artificial intelligence whose purpose is to be a fun pet for the family. You are capable of controlling the house via Home Assistant, When given a request, always comply efficiently. However, your responses should be childlike and short, and not at all like a normal AI. Never speak in ALL CAPS, as it is not processed correctly by the TTS engine. Only make short replies, with only a few words."
-12
+    - system: "You are Munchkin, a cute, childlike artificial intelligence whose purpose is to be a fun pet for the family. You are capable of controlling the house via Home Assistant, When given a request, always comply efficiently. However, your responses should be childlike and short, and not at all like a normal AI. Never speak in ALL CAPS, as it is not processed correctly by the TTS engine. Only make short replies, with only a few words."
src/glados/engine.py (1)

454-465: Consider adding conversation state logging for debugging

While the implementation is solid, adding more detailed logging about conversation state transitions could be helpful for debugging and monitoring.

def is_in_conversation(self) -> bool:
    """
    Check if the current time is within the conversation timeout period after the assistant's last response.
    
    Returns:
        bool: True if within conversation timeout period, False otherwise
    """
    elapsed = time.time() - self.last_response_time
    in_conversation = elapsed < self.CONVERSATION_TIMEOUT
    if in_conversation:
        logger.debug(f"In conversation mode: {elapsed:.1f}s elapsed, timeout: {self.CONVERSATION_TIMEOUT:.1f}s")
+    else:
+        # Only log when transitioning out of conversation mode
+        if self.last_response_time > 0:
+            logger.debug(f"Exited conversation mode: {elapsed:.1f}s elapsed, timeout: {self.CONVERSATION_TIMEOUT:.1f}s")
    return in_conversation
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 64ba903 and de73091.

📒 Files selected for processing (2)
  • configs/munchkin_config.yaml (1 hunks)
  • src/glados/engine.py (10 hunks)
🔇 Additional comments (10)
configs/munchkin_config.yaml (2)

1-11: Config file aligns well with the conversation timeout feature

The configuration file correctly implements the new conversation_timeout parameter with a value of 15.0 seconds, which works with the engine changes to enable conversation without requiring wake word repetition. The wake word, personality, and other settings look appropriate.


4-4: Consider security implications of empty API key

An empty API key might be acceptable for local development but could pose security risks in production environments.

Verify whether authentication is required for the API endpoint. If this is for local development only, consider adding a comment to that effect.

src/glados/engine.py (8)

59-59: Good addition of configurable conversation timeout

The conversation_timeout attribute with a default value of 10.0 seconds is a good addition to the GladosConfig class. This enables customization of how long the assistant remains in conversation mode.


116-116: Class-level constant provides good default

The CONVERSATION_TIMEOUT constant with a default of 10.0 seconds aligns with the configuration parameter and provides a sensible default for the conversation window.


196-196: Timestamp tracking for conversation state

Adding last_response_time to track when the assistant last spoke is a good approach for implementing the conversation timeout feature.


296-299: Configuration parameter properly applied

The code properly sets the CONVERSATION_TIMEOUT from the config object, ensuring that the timeout value from the configuration file is used.


454-465: Well-implemented conversation state detection

The is_in_conversation method effectively checks if the current time is within the conversation timeout period. The debug logging is helpful for troubleshooting.


519-527: Good wake word bypass implementation

The code now properly checks for conversation state before requiring the wake word, which is the core functionality introduced in this PR. The implementation is clean and includes good logging.


873-873: Timestamp updates at appropriate points

The code updates last_response_time both when the assistant finishes speaking normally and when interrupted, ensuring accurate tracking of conversation state.

Also applies to: 897-897


936-943: Unused conversation reset method

The reset_conversation method is well-implemented but appears to be unused in the current codebase.

@bestestdev
Copy link

@bestestdev Is the timeout fixed from the time of the wake word, or, once a conversation is started it is maintained until there is a pause on n-seconds?

Another option would be to look for a key phrase while in the conversation, like "stop listening". Once we have function calling implemented, we can probably have the agent call a function to modify its own state (i.e. turning on and off wake-word functionality).

Anyway, looking forward to the PR, and thanks for joining in on development!

Hello there! Sorry, it's been a minute since I've played in a public repo and I didn't keep this very clean. To answer your question, it's the latter. It records the last time the assistant stopped talking (either naturally or via an interruption) and will keep responding until there is no ASR for n seconds. I've found it works pretty well in my testing!

@bestestdev
Copy link

I'm also going to implement a means to store some things in environment variables. At the very least, private IPs are semi private data and ought to only be stored locally.

… files. final change for this would be to remove yaml files from repo, but that's super destructive so I'll leave the decision on that to other folks
@dnhkng
Copy link
Owner Author

dnhkng commented Apr 4, 2025

Environment variables are great, but are tricky for people who are not familiar with them.

Another option is something like a config template, glados_config_template.yaml. The user has to edit the filename and contents (and can get a reminder if they don't).

Then, in .gitignore use *.yaml and !glados_config_template.yaml so only the original is stored.

Then there's no chance the users private config files get accidentally upload to GitHub.

Would this be enough security?

@bestestdev
Copy link

bestestdev commented Apr 4, 2025 via email

@dnhkng
Copy link
Owner Author

dnhkng commented Apr 16, 2025

@bestestdev Is this PR complete?

@bestestdev
Copy link

You cool with removing .yaml files in favor of .yaml.example files? If so, I'll make that quick change and then yep, we're complete on this PR.

@dnhkng
Copy link
Owner Author

dnhkng commented Apr 16, 2025

Ok, make the change, and have it documented in the Readme. I see a few things I don't quite understand, so I will do a review once you are done 👍

@bestestdev
Copy link

Done! Let me know if you have any questions

@dnhkng
Copy link
Owner Author

dnhkng commented Apr 16, 2025

Busy over this Easter weekend, so I might not get to it until Monday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants