Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle profile updates #36

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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