Skip to content

Commit 13a2947

Browse files
authored
add allow_connection override to async (#418)
1 parent 5631879 commit 13a2947

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/hume/empathic_voice/chat/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ async def connect(
204204
verbose_transcription: typing.Optional[bool] = None,
205205
api_key: typing.Optional[str] = None,
206206
session_settings: typing.Optional[ConnectSessionSettings] = None,
207+
allow_connection: typing.Optional[bool] = None,
207208
request_options: typing.Optional[RequestOptions] = None,
208209
) -> typing.AsyncIterator[AsyncChatSocketClient]:
209210
"""
@@ -260,6 +261,11 @@ async def connect(
260261
261262
session_settings : ConnectSessionSettings
262263
264+
allow_connection : typing.Optional[bool]
265+
Flag that allows the resulting Chat to accept secondary connections via
266+
the control plane `/connect` endpoint. Defaults to `False` on the server.
267+
Set to `True` to enable observer connections for the session.
268+
263269
request_options : typing.Optional[RequestOptions]
264270
Request-specific configuration.
265271
@@ -283,6 +289,8 @@ async def connect(
283289
query_params = query_params.add("verbose_transcription", verbose_transcription)
284290
if api_key is not None:
285291
query_params = query_params.add("api_key", api_key)
292+
if allow_connection is not None:
293+
query_params = query_params.add("allow_connection", str(allow_connection).lower())
286294
if session_settings is not None:
287295
flattened_params = single_query_encoder("session_settings", session_settings)
288296
for param_key, param_value in flattened_params:

0 commit comments

Comments
 (0)