# pacificbelt30/gameassistant architecture

> Architecture diagram of the GitHub repository pacificbelt30/gameassistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pacificbelt30/gameassistant
- Repository: https://github.com/pacificbelt30/gameassistant

## Overview

##### Main Components
- Main Entry Point: Represent the main program (src/main.py) that initializes and orchestrates the various assistant functionalities.
- Assistant Modules: Within the src/assistant folder, you have sub-modules like:
– ai.py: Likely for overall AI decision-making or coordination.
– screenshot.py: Handles screenshot capture, possibly for analyzing game visuals.
– whisper.py: Integrates with the Whisper AI library for speech recognition.
– voicevox.py: Connects with Voicevox for voice synthesis.
- Utility Functions: Located in src/utils, particularly image_processing.py that supports image-related tasks.
- Third-Party Integrations: The third-party directory includes ReazonSpeech; this should be included as an external service or integration component.

##### Relationships and Interactions
- The main entry point (src/main.py) serves as the central hub. From here, it delegates tasks to the assistant modules.
- The assistant modules work in tandem:
– The whisper module processes audio input.
– The voicevox module handles text-to-speech or voice feedback.
– The screenshot module might capture in-game images, which are processed via image_processing utilities.
– The ai module could orchestrate decision logic or interactions between these input and output functionalities.

##### Architectural Patterns and Design Principles
- Modular Design: The separation between assistant components (each with a distinct responsibility) suggests a modular architecture.
- Layered Interaction: Consider how the core business logic (AI decisions) layers on top of I/O and data processing modules.
- Third-Party Compatibility: Integration of libraries such as Ctranslate2 (mentioned in the README) and components like ReazonSpeech emphasizes a design reliant on external dependencies that may affect performance (as also highlighted in the Whisper setup instructions).

##### Technologies and Frameworks
- Python: This is the main programming language.
- AI Libraries: Whisper for speech recognition and Voicevox for voice synthesis.
- External Dependencies: Ctranslate2 configuration settings in the README indicate the use of translation models that need to be configured based on hardware capabilities.
- CI/CD: GitHub Workflows indicate automated testing or deployment processes.

## Diagram (Mermaid)

```mermaid
graph TD
    Main["Main Module (src/main.py)"]:::mainClass

    subgraph "Assistant Modules"
        AI["Assistant: AI (ai.py)"]:::assistantClass
        SS["Assistant: Screenshot (screenshot.py)"]:::assistantClass
        W["Assistant: Whisper (whisper.py)"]:::assistantClass
        VV["Assistant: Voicevox (voicevox.py)"]:::assistantClass
    end

    subgraph "Utility Modules"
        Util["Utils: Image Processing (image_processing.py)"]:::utilClass
    end

    ThirdParty["Third-Party: ReazonSpeech"]:::externalClass
    CICD["CI/CD: GitHub Workflows"]:::cicdClass

    Main -->|"calls"| AI
    Main -->|"calls"| SS
    Main -->|"calls"| W
    Main -->|"calls"| VV

    SS -->|"processes"| Util
    W -->|"transcribes"| AI
    W -->|"transcribes"| VV
    AI -->|"signals"| VV

    Main -->|"integrates"| ThirdParty
    CICD ---|"build_deploy"| Main

    click Main "https://github.com/pacificbelt30/gameassistant/blob/main/src/main.py"
    click AI "https://github.com/pacificbelt30/gameassistant/blob/main/src/assistant/ai.py"
    click SS "https://github.com/pacificbelt30/gameassistant/blob/main/src/assistant/screenshot.py"
    click W "https://github.com/pacificbelt30/gameassistant/blob/main/src/assistant/whisper.py"
    click VV "https://github.com/pacificbelt30/gameassistant/blob/main/src/assistant/voicevox.py"
    click Util "https://github.com/pacificbelt30/gameassistant/blob/main/src/utils/image_processing.py"
    click ThirdParty "https://github.com/pacificbelt30/gameassistant/tree/main/third-party/ReazonSpeech"
    click CICD "https://github.com/pacificbelt30/gameassistant/blob/main/.github"

    classDef mainClass fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef assistantClass fill:#A9DFBF,stroke:#229954,stroke-width:2px;
    classDef utilClass fill:#FAD7A0,stroke:#CA6F1E,stroke-width:2px;
    classDef externalClass fill:#E74C3C,stroke:#A93226,stroke-width:2px;
    classDef cicdClass fill:#D7BDE2,stroke:#7D3C98,stroke-width:2px;
```
