Skip to content

Commit

Permalink
Handle user profile updates from Neon
Browse files Browse the repository at this point in the history
Handle MQ connection errors with useful log in CLI
Update default config for Docker
  • Loading branch information
NeonDaniel committed Nov 21, 2023
1 parent 68378bd commit cef5218
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
26 changes: 25 additions & 1 deletion docker_overlay/etc/neon/neon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,28 @@ iris:
- en-us
- fr-fr
- es-es
- uk-ua
- de-de
- it-it
- uk-ua
- nl-nl
- pt-pt
- 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
8 changes: 6 additions & 2 deletions neon_iris/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,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 OSError:
click.echo("Unable to connect to MQ server")


@neon_iris_cli.command(help="Transcribe an audio file")
Expand Down
9 changes: 9 additions & 0 deletions neon_iris/web_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,15 @@ def handle_api_response(self, message: Message):
"""
LOG.debug(f"Got {message.msg_type}: {message.data}")

def _handle_profile_update(self, message: Message):
updated_profile = message.data["profile"]
session_id = updated_profile['user']['username']
if session_id in self._profiles:
LOG.info(f"Got profile update for {session_id}")
self._profiles[session_id] = updated_profile
else:
LOG.warning(f"Ignoring profile update for {session_id}")

def handle_error_response(self, message: Message):
"""
Handle an error response from the MQ service attached to Neon. This
Expand Down

0 comments on commit cef5218

Please sign in to comment.