Skip to content

Commit

Permalink
fix: update async iterator to parse incoming message
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Sep 11, 2024
1 parent fb423bc commit 07ff2e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/hume/empathic_voice/chat/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(

async def __aiter__(self):
async for message in self.websocket:
yield message
yield parse_obj_as(SubscribeEvent, json.loads(message))

async def _send(self, data: typing.Any) -> None:
if isinstance(data, dict):
Expand Down
2 changes: 1 addition & 1 deletion src/hume/expression_measurement/stream/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(

async def __aiter__(self):
async for message in self.websocket:
yield message
yield parse_obj_as(SubscribeEvent, json.loads(message)) # type: ignore

# TODO: we can likely coerce the right response model within the union here, if we're
# assuming request-response pattern and 1:1 mapping between request and response types
Expand Down

0 comments on commit 07ff2e8

Please sign in to comment.