ovos-installer icon indicating copy to clipboard operation
ovos-installer copied to clipboard

Add autoconfig support to installer

Open suvanbanerjee opened this issue 1 year ago • 12 comments

Closes #157

Summary by CodeRabbit

  • New Features

    • Introduced automatic configuration for Speech-to-Text (STT) and Text-to-Speech (TTS) based on user language settings.
    • Enhanced configuration for STT and TTS auto-configuration when the installation profile is set to "satellite".
    • Added performance improvements in task execution for managing virtual environments.
  • Bug Fixes

    • Improved readability and performance in existing tasks without altering functionality.

suvanbanerjee avatar Oct 09 '24 13:10 suvanbanerjee

@goldyfruit will this file structure work, I will ask user for autoconfig questions and then run the command accordingly, to tackle the region issue we can find region using their ip to detect their country so if someone chooses English in Australia then its en-au, en-> from his language choice au-> from his country ip

suvanbanerjee avatar Oct 09 '24 13:10 suvanbanerjee

@goldyfruit will this file structure work, I will ask user for autoconfig questions and then run the command accordingly, to tackle the region issue we can find region using their ip to detect their country so if someone chooses English in Australia then its en-au, en-> from his language choice au-> from his country ip

i wouldnt worry about this for now, as the translations currently are all for en-us , setting a different code might just cause issues with no benefit

only portuguese currently differentiates between pt-br and pt-pt, no other language supports different dialect lang codes (yet)

JarbasAl avatar Oct 10 '24 10:10 JarbasAl

I would not prompt any questions about the auto configuration. By default if French is selected then the assistant should be configured to in French, etc...

About the male or female voice, this question should be handle by the core team as its part of the OVOS's persona.

@JarbasAl @j1nx Do we want to have a male or female persona?

goldyfruit avatar Oct 10 '24 13:10 goldyfruit

team

If not prompting user, keep it male

JarbasAl avatar Oct 10 '24 16:10 JarbasAl

If not prompting user, keep it male

I guess the standard for voice assistant is female ?

suvanbanerjee avatar Oct 10 '24 16:10 suvanbanerjee

If not prompting user, keep it male

I guess the standard for voice assistant is female ?

historically we have used the male voice from alan pope, which goes well with "hey mycroft". let's keep it that way

besides, its a good differentiation factor in comparison with other voice assistants

JarbasAl avatar Oct 10 '24 17:10 JarbasAl

@suvanbanerjee I just pushed a commit, please have a look.

goldyfruit avatar Oct 10 '24 21:10 goldyfruit

Walkthrough

The pull request introduces new tasks in Ansible playbooks for auto-configuration of Speech-to-Text (STT) and Text-to-Speech (TTS) using the ovos-config command. This feature is conditionally executed based on the user's profile, specifically when it is not set to "server". Minor formatting adjustments were made to enhance the readability of existing tasks without altering their functionality.

Changes

File Path Change Summary
ansible/roles/ovos_installer/tasks/docker/composer.yml Added task for running ovos-config for STT and TTS auto-configuration; minor formatting adjustments made.
ansible/roles/ovos_installer/tasks/virtualenv/venv.yml Introduced task for running ovos-config for STT and TTS auto-configuration; updated file ownership command for performance.

Assessment against linked issues

Objective Addressed Explanation
Use ovos-config for STT and TTS auto-configuration (#[157])

🐇 In the garden where the code does play,
New tasks bloom bright, guiding the way.
With ovos-config, we sing and cheer,
Auto-configured voices, loud and clear!
TTS and STT, together they thrive,
In the world of speech, we come alive! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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 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.

coderabbitai[bot] avatar Oct 10 '24 21:10 coderabbitai[bot]

mycroft.conf generated by the ovos-config seems off.

{
  "log_level": "INFO",
  "play_wav_cmdline": "pw-play %1",
  "play_mp3_cmdline": "pw-play %1",
  "lang": "ca-ES",
  "listener": {
    "remove_silence": true,
    "VAD": {
      "module": "ovos-vad-plugin-silero"
    },
    "instant_listen": true
  },
  "skills": {
    "installer": {
      "allow_pip": true,
      "allow_alphas": true
    }
  },
  "websocket": {
    "max_msg_size": 25
  },
  "PHAL": {
    "ovos-PHAL-plugin-wifi-setup": {
      "module": "ovos-PHAL-plugin-wifi-setup",
      "lang": "ca-ES",
      "secondary_langs": [],
      "system_unit": "metric",
      "temperature_unit": "celsius",
      "windspeed_unit": "km/h",
      "precipitation_unit": "mm",
      "time_format": "full",
      "spoken_time_format": "half",
      "date_format": "DMY",
      "opt_in": false,
      "confirm_listening": true,
      "ready_settings": [
        "skills"
      ],
      "ignore_logs": [
        "enclosure.mouth.viseme",
        "enclosure.mouth.display"
      ],
      "enable_old_audioservice": true,
      "debug": false,
      "log_level": "INFO",
      "play_wav_cmdline": "pw-play %1",
      "play_mp3_cmdline": "pw-play %1",
      "first_boot": false
    }
  },
  "tts": {
    "ovos-tts-plugin-server": {
      "host": [
        "https://tts.smartgic.io/matxa",
        "https://matxa.ziggyai.online"
      ],
      "voice": "central/grau"
    },
    "module": "ovos-tts-plugin-server"
  },
  "stt": {
    "ovos-stt-plugin-server": {
      "url": [
        "https://stt.smartgic.io/citrinet",
        "https://citrinetstt.ziggyai.online"
      ]
    },
    "module": "ovos-stt-plugin-server",
    "fallback_module": ""
  },
  "system_unit": "metric",
  "temperature_unit": "celsius",
  "windspeed_unit": "km/h",
  "precipitation_unit": "mm",
  "time_format": "full",
  "spoken_time_format": "half",
  "date_format": "DMY"
}

goldyfruit avatar Oct 10 '24 22:10 goldyfruit

mycroft.conf generated by the ovos-config seems off.

{
  "log_level": "INFO",
  "play_wav_cmdline": "pw-play %1",
  "play_mp3_cmdline": "pw-play %1",
  "lang": "ca-ES",
  "listener": {
    "remove_silence": true,
    "VAD": {
      "module": "ovos-vad-plugin-silero"
    },
    "instant_listen": true
  },
  "skills": {
    "installer": {
      "allow_pip": true,
      "allow_alphas": true
    }
  },
  "websocket": {
    "max_msg_size": 25
  },
  "PHAL": {
    "ovos-PHAL-plugin-wifi-setup": {
      "module": "ovos-PHAL-plugin-wifi-setup",
      "lang": "ca-ES",
      "secondary_langs": [],
      "system_unit": "metric",
      "temperature_unit": "celsius",
      "windspeed_unit": "km/h",
      "precipitation_unit": "mm",
      "time_format": "full",
      "spoken_time_format": "half",
      "date_format": "DMY",
      "opt_in": false,
      "confirm_listening": true,
      "ready_settings": [
        "skills"
      ],
      "ignore_logs": [
        "enclosure.mouth.viseme",
        "enclosure.mouth.display"
      ],
      "enable_old_audioservice": true,
      "debug": false,
      "log_level": "INFO",
      "play_wav_cmdline": "pw-play %1",
      "play_mp3_cmdline": "pw-play %1",
      "first_boot": false
    }
  },
  "tts": {
    "ovos-tts-plugin-server": {
      "host": [
        "https://tts.smartgic.io/matxa",
        "https://matxa.ziggyai.online"
      ],
      "voice": "central/grau"
    },
    "module": "ovos-tts-plugin-server"
  },
  "stt": {
    "ovos-stt-plugin-server": {
      "url": [
        "https://stt.smartgic.io/citrinet",
        "https://citrinetstt.ziggyai.online"
      ]
    },
    "module": "ovos-stt-plugin-server",
    "fallback_module": ""
  },
  "system_unit": "metric",
  "temperature_unit": "celsius",
  "windspeed_unit": "km/h",
  "precipitation_unit": "mm",
  "time_format": "full",
  "spoken_time_format": "half",
  "date_format": "DMY"
}

I removed the ovos-PHAL-plugin-wifi-setup package which is the culprit.

goldyfruit avatar Oct 11 '24 00:10 goldyfruit

thanks @goldyfruit for the pr's it made my job super easy 😅, i think this pr is ready to review and push, if there are any more changes please require do tell me

suvanbanerjee avatar Oct 11 '24 02:10 suvanbanerjee

thanks @goldyfruit for the pr's it made my job super easy 😅

I mostly did it as you can learn from it for the next time.

goldyfruit avatar Oct 11 '24 03:10 goldyfruit

@suvanbanerjee have you tried this PR?

goldyfruit avatar Oct 11 '24 11:10 goldyfruit