diff --git a/docker_overlay/etc/neon/neon.yaml b/docker_overlay/etc/neon/neon.yaml index 569d53c..0a48cef 100644 --- a/docker_overlay/etc/neon/neon.yaml +++ b/docker_overlay/etc/neon/neon.yaml @@ -21,4 +21,23 @@ iris: - uk-ua - nl-nl - pt-pt - - ca-es \ No newline at end of file + - ca-es + +location: + city: + code: Renton + name: Renton + state: + code: WA + name: Washington + country: + code: US + name: United States + coordinate: + latitude: 47.482880 + longitude: -122.217064 + timezone: + code: America/Los_Angeles + name: Pacific Standard Time + dstOffset: 3600000 + offset: -28800000 \ No newline at end of file diff --git a/neon_iris/cli.py b/neon_iris/cli.py index e7e6cef..cefba9c 100644 --- a/neon_iris/cli.py +++ b/neon_iris/cli.py @@ -25,6 +25,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import logging +import socket from pprint import pformat import click @@ -132,8 +133,12 @@ def start_listener(): @neon_iris_cli.command(help="Create a GradIO Client session") def start_gradio(): from neon_iris.web_client import GradIOClient - chat = GradIOClient() - chat.run() + _print_config() + try: + chat = GradIOClient() + chat.run() + except socket.gaierror: + click.echo("Unable to connect to MQ server") @neon_iris_cli.command(help="Transcribe an audio file") diff --git a/neon_iris/client.py b/neon_iris/client.py index 566b143..334901b 100644 --- a/neon_iris/client.py +++ b/neon_iris/client.py @@ -69,20 +69,23 @@ def __init__(self, mq_config: dict = None, config_dir: str = None): self.audio_cache_dir = join(xdg_cache_home(), "neon", "neon_iris") makedirs(self.audio_cache_dir, exist_ok=True) + config = Configuration().get("iris", {}) + # Collect supported languages - message = self._build_message("ovos.languages.stt", {}) - self._send_message(message) - message = self._build_message("ovos.languages.tts", {}) - self._send_message(message) - if self._language_init.wait(30): - LOG.info(f"Got language support: {self._languages}") - else: - self._languages['stt'] = self._config.get('iris', - {}).get('languages') - self._languages['tts'] = self._config.get('iris', - {}).get('languages') - LOG.warning(f"Timed out updating languages. Using configuration: " - f"{self._languages}") + if config.get("enable_lang_api"): + message = self._build_message("ovos.languages.stt", {}) + self._send_message(message) + message = self._build_message("ovos.languages.tts", {}) + self._send_message(message) + + if self._language_init.wait(30): + LOG.info(f"Got language support: {self._languages}") + + if not self._languages: + lang_config = config.get('languages') or [] + self._languages['stt'] = lang_config + self._languages['tts'] = lang_config + LOG.debug(f"Using supported langs configuration: {self._languages}") @property def uid(self) -> str: