Skip to content

Commit

Permalink
add missing query params to /chat endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
twitchard committed Nov 6, 2024
1 parent 7cca37c commit 4400236
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/hume/empathic_voice/chat/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class ChatConnectOptions(typing.TypedDict, total=False):

secret_key: typing.Optional[str]

resumed_chat_group_id: typing.Optional[str]

verbose_transcription: typing.Optional[bool]


class ChatWebsocketConnection:
DEFAULT_NUM_CHANNELS: typing.ClassVar[int] = 1
Expand Down Expand Up @@ -204,6 +208,16 @@ async def _construct_ws_uri(self, options: typing.Optional[ChatConnectOptions]):
query_params = query_params.add(
"config_version", maybe_config_version
)
maybe_resumed_chat_group_id = options.get("resumed_chat_group_id")
if maybe_resumed_chat_group_id is not None:
query_params = query_params.add(
"resumed_chat_group_id", maybe_resumed_chat_group_id
)
maybe_verbose_transcription = options.get("verbose_transcription")
if maybe_verbose_transcription is not None:
query_params = query_params.add(
"verbose_transcription", "true" if maybe_verbose_transcription else "false"
)
maybe_secret_key = options.get("secret_key")
if maybe_secret_key is not None and api_key is not None:
query_params = query_params.add(
Expand Down

0 comments on commit 4400236

Please sign in to comment.