|
| 1 | +diff --git a/src/hume/empathic_voice/chat/raw_client.py b/src/hume/empathic_voice/chat/raw_client.py |
| 2 | +index fefee870..23e2b4a0 100644 |
| 3 | +--- a/src/hume/empathic_voice/chat/raw_client.py |
| 4 | ++++ b/src/hume/empathic_voice/chat/raw_client.py |
| 5 | +@@ -10,7 +10,6 @@ from ...core.api_error import ApiError |
| 6 | + from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper |
| 7 | + from ...core.request_options import RequestOptions |
| 8 | + from ...core.serialization import convert_and_respect_annotation_metadata |
| 9 | +-from ...core.query_encoder import single_query_encoder |
| 10 | + from ..types.connect_session_settings import ConnectSessionSettings |
| 11 | + from .socket_client import AsyncChatSocketClient, ChatSocketClient |
| 12 | + |
| 13 | +@@ -29,6 +28,7 @@ class RawChatClient: |
| 14 | + self, |
| 15 | + *, |
| 16 | + access_token: typing.Optional[str] = None, |
| 17 | ++ allow_connection: typing.Optional[bool] = None, |
| 18 | + config_id: typing.Optional[str] = None, |
| 19 | + config_version: typing.Optional[int] = None, |
| 20 | + event_limit: typing.Optional[int] = None, |
| 21 | +@@ -50,12 +50,15 @@ class RawChatClient: |
| 22 | + |
| 23 | + For more details, refer to the [Authentication Strategies Guide](/docs/introduction/api-key#authentication-strategies). |
| 24 | + |
| 25 | ++ allow_connection : typing.Optional[bool] |
| 26 | ++ Allows external connections to this chat via the /connect endpoint. |
| 27 | ++ |
| 28 | + config_id : typing.Optional[str] |
| 29 | + The unique identifier for an EVI configuration. |
| 30 | + |
| 31 | +- Include this ID in your connection request to equip EVI with the Prompt, Language Model, Voice, and Tools associated with the specified configuration. If omitted, EVI will apply [default configuration settings](/docs/speech-to-speech-evi/configuration/build-a-configuration#default-configuration). |
| 32 | ++ Include this ID in your connection request to equip EVI with the Prompt, Language Model, Voice, and Tools associated with the specified configuration. If omitted, EVI will apply [default configuration settings](/docs/empathic-voice-interface-evi/configuration#default-configuration). |
| 33 | + |
| 34 | +- For help obtaining this ID, see our [Configuration Guide](/docs/speech-to-speech-evi/configuration). |
| 35 | ++ For help obtaining this ID, see our [Configuration Guide](/docs/empathic-voice-interface-evi/configuration). |
| 36 | + |
| 37 | + config_version : typing.Optional[int] |
| 38 | + The version number of the EVI configuration specified by the `config_id`. |
| 39 | +@@ -76,19 +79,16 @@ class RawChatClient: |
| 40 | + |
| 41 | + There are three ways to obtain the Chat Group ID: |
| 42 | + |
| 43 | +- - [Chat Metadata](/reference/speech-to-speech-evi/chat#receive.ChatMetadata): Upon establishing a WebSocket connection with EVI, the user receives a Chat Metadata message. This message contains a `chat_group_id`, which can be used to resume conversations within this chat group in future sessions. |
| 44 | ++ - [Chat Metadata](/reference/empathic-voice-interface-evi/chat/chat#receive.Chat%20Metadata.type): Upon establishing a WebSocket connection with EVI, the user receives a Chat Metadata message. This message contains a `chat_group_id`, which can be used to resume conversations within this chat group in future sessions. |
| 45 | + |
| 46 | +- - [List Chats endpoint](/reference/speech-to-speech-evi/chats/list-chats): Use the GET `/v0/evi/chats` endpoint to obtain the Chat Group ID of individual Chat sessions. This endpoint lists all available Chat sessions and their associated Chat Group ID. |
| 47 | ++ - [List Chats endpoint](/reference/empathic-voice-interface-evi/chats/list-chats): Use the GET `/v0/evi/chats` endpoint to obtain the Chat Group ID of individual Chat sessions. This endpoint lists all available Chat sessions and their associated Chat Group ID. |
| 48 | + |
| 49 | +- - [List Chat Groups endpoint](/reference/speech-to-speech-evi/chat-groups/list-chat-groups): Use the GET `/v0/evi/chat_groups` endpoint to obtain the Chat Group IDs of all Chat Groups associated with an API key. This endpoint returns a list of all available chat groups. |
| 50 | ++ - [List Chat Groups endpoint](/reference/empathic-voice-interface-evi/chat-groups/list-chat-groups): Use the GET `/v0/evi/chat_groups` endpoint to obtain the Chat Group IDs of all Chat Groups associated with an API key. This endpoint returns a list of all available chat groups. |
| 51 | + |
| 52 | + verbose_transcription : typing.Optional[bool] |
| 53 | +- A flag to enable verbose transcription. Set this query parameter to `true` to have unfinalized user transcripts be sent to the client as interim UserMessage messages. The [interim](/reference/speech-to-speech-evi/chat#receive.UserMessage.interim) field on a [UserMessage](/reference/speech-to-speech-evi/chat#receive.UserMessage) denotes whether the message is "interim" or "final." |
| 54 | ++ A flag to enable verbose transcription. Set this query parameter to `"true"` to have unfinalized user transcripts be sent to the client as interim `UserMessage` messages. |
| 55 | + |
| 56 | + api_key : typing.Optional[str] |
| 57 | +- API key used for authenticating the client. If not provided, an `access_token` must be provided to authenticate. |
| 58 | +- |
| 59 | +- For more details, refer to the [Authentication Strategies Guide](/docs/introduction/api-key#authentication-strategies). |
| 60 | + |
| 61 | + session_settings : ConnectSessionSettings |
| 62 | + |
| 63 | +@@ -103,6 +103,8 @@ class RawChatClient: |
| 64 | + query_params = httpx.QueryParams() |
| 65 | + if access_token is not None: |
| 66 | + query_params = query_params.add("access_token", access_token) |
| 67 | ++ if allow_connection is not None: |
| 68 | ++ query_params = query_params.add("allow_connection", allow_connection) |
| 69 | + if config_id is not None: |
| 70 | + query_params = query_params.add("config_id", config_id) |
| 71 | + if config_version is not None: |
| 72 | +@@ -115,10 +117,18 @@ class RawChatClient: |
| 73 | + query_params = query_params.add("verbose_transcription", verbose_transcription) |
| 74 | + if api_key is not None: |
| 75 | + query_params = query_params.add("api_key", api_key) |
| 76 | +- if session_settings is not None: |
| 77 | +- flattened_params = single_query_encoder("session_settings", session_settings) |
| 78 | +- for param_key, param_value in flattened_params: |
| 79 | +- query_params = query_params.add(param_key, str(param_value)) |
| 80 | ++ if ( |
| 81 | ++ convert_and_respect_annotation_metadata( |
| 82 | ++ object_=session_settings, annotation=ConnectSessionSettings, direction="write" |
| 83 | ++ ) |
| 84 | ++ is not None |
| 85 | ++ ): |
| 86 | ++ query_params = query_params.add( |
| 87 | ++ "session_settings", |
| 88 | ++ convert_and_respect_annotation_metadata( |
| 89 | ++ object_=session_settings, annotation=ConnectSessionSettings, direction="write" |
| 90 | ++ ), |
| 91 | ++ ) |
| 92 | + ws_url = ws_url + f"?{query_params}" |
| 93 | + headers = self._client_wrapper.get_headers() |
| 94 | + if request_options and "additional_headers" in request_options: |
| 95 | +@@ -150,6 +160,7 @@ class AsyncRawChatClient: |
| 96 | + self, |
| 97 | + *, |
| 98 | + access_token: typing.Optional[str] = None, |
| 99 | ++ allow_connection: typing.Optional[bool] = None, |
| 100 | + config_id: typing.Optional[str] = None, |
| 101 | + config_version: typing.Optional[int] = None, |
| 102 | + event_limit: typing.Optional[int] = None, |
| 103 | +@@ -171,12 +182,15 @@ class AsyncRawChatClient: |
| 104 | + |
| 105 | + For more details, refer to the [Authentication Strategies Guide](/docs/introduction/api-key#authentication-strategies). |
| 106 | + |
| 107 | ++ allow_connection : typing.Optional[bool] |
| 108 | ++ Allows external connections to this chat via the /connect endpoint. |
| 109 | ++ |
| 110 | + config_id : typing.Optional[str] |
| 111 | + The unique identifier for an EVI configuration. |
| 112 | + |
| 113 | +- Include this ID in your connection request to equip EVI with the Prompt, Language Model, Voice, and Tools associated with the specified configuration. If omitted, EVI will apply [default configuration settings](/docs/speech-to-speech-evi/configuration/build-a-configuration#default-configuration). |
| 114 | ++ Include this ID in your connection request to equip EVI with the Prompt, Language Model, Voice, and Tools associated with the specified configuration. If omitted, EVI will apply [default configuration settings](/docs/empathic-voice-interface-evi/configuration#default-configuration). |
| 115 | + |
| 116 | +- For help obtaining this ID, see our [Configuration Guide](/docs/speech-to-speech-evi/configuration). |
| 117 | ++ For help obtaining this ID, see our [Configuration Guide](/docs/empathic-voice-interface-evi/configuration). |
| 118 | + |
| 119 | + config_version : typing.Optional[int] |
| 120 | + The version number of the EVI configuration specified by the `config_id`. |
| 121 | +@@ -197,19 +211,16 @@ class AsyncRawChatClient: |
| 122 | + |
| 123 | + There are three ways to obtain the Chat Group ID: |
| 124 | + |
| 125 | +- - [Chat Metadata](/reference/speech-to-speech-evi/chat#receive.ChatMetadata): Upon establishing a WebSocket connection with EVI, the user receives a Chat Metadata message. This message contains a `chat_group_id`, which can be used to resume conversations within this chat group in future sessions. |
| 126 | ++ - [Chat Metadata](/reference/empathic-voice-interface-evi/chat/chat#receive.Chat%20Metadata.type): Upon establishing a WebSocket connection with EVI, the user receives a Chat Metadata message. This message contains a `chat_group_id`, which can be used to resume conversations within this chat group in future sessions. |
| 127 | + |
| 128 | +- - [List Chats endpoint](/reference/speech-to-speech-evi/chats/list-chats): Use the GET `/v0/evi/chats` endpoint to obtain the Chat Group ID of individual Chat sessions. This endpoint lists all available Chat sessions and their associated Chat Group ID. |
| 129 | ++ - [List Chats endpoint](/reference/empathic-voice-interface-evi/chats/list-chats): Use the GET `/v0/evi/chats` endpoint to obtain the Chat Group ID of individual Chat sessions. This endpoint lists all available Chat sessions and their associated Chat Group ID. |
| 130 | + |
| 131 | +- - [List Chat Groups endpoint](/reference/speech-to-speech-evi/chat-groups/list-chat-groups): Use the GET `/v0/evi/chat_groups` endpoint to obtain the Chat Group IDs of all Chat Groups associated with an API key. This endpoint returns a list of all available chat groups. |
| 132 | ++ - [List Chat Groups endpoint](/reference/empathic-voice-interface-evi/chat-groups/list-chat-groups): Use the GET `/v0/evi/chat_groups` endpoint to obtain the Chat Group IDs of all Chat Groups associated with an API key. This endpoint returns a list of all available chat groups. |
| 133 | + |
| 134 | + verbose_transcription : typing.Optional[bool] |
| 135 | +- A flag to enable verbose transcription. Set this query parameter to `true` to have unfinalized user transcripts be sent to the client as interim UserMessage messages. The [interim](/reference/speech-to-speech-evi/chat#receive.UserMessage.interim) field on a [UserMessage](/reference/speech-to-speech-evi/chat#receive.UserMessage) denotes whether the message is "interim" or "final." |
| 136 | ++ A flag to enable verbose transcription. Set this query parameter to `"true"` to have unfinalized user transcripts be sent to the client as interim `UserMessage` messages. |
| 137 | + |
| 138 | + api_key : typing.Optional[str] |
| 139 | +- API key used for authenticating the client. If not provided, an `access_token` must be provided to authenticate. |
| 140 | +- |
| 141 | +- For more details, refer to the [Authentication Strategies Guide](/docs/introduction/api-key#authentication-strategies). |
| 142 | + |
| 143 | + session_settings : ConnectSessionSettings |
| 144 | + |
| 145 | +@@ -224,6 +235,8 @@ class AsyncRawChatClient: |
| 146 | + query_params = httpx.QueryParams() |
| 147 | + if access_token is not None: |
| 148 | + query_params = query_params.add("access_token", access_token) |
| 149 | ++ if allow_connection is not None: |
| 150 | ++ query_params = query_params.add("allow_connection", allow_connection) |
| 151 | + if config_id is not None: |
| 152 | + query_params = query_params.add("config_id", config_id) |
| 153 | + if config_version is not None: |
| 154 | +@@ -236,10 +249,18 @@ class AsyncRawChatClient: |
| 155 | + query_params = query_params.add("verbose_transcription", verbose_transcription) |
| 156 | + if api_key is not None: |
| 157 | + query_params = query_params.add("api_key", api_key) |
| 158 | +- if session_settings is not None: |
| 159 | +- flattened_params = single_query_encoder("session_settings", session_settings) |
| 160 | +- for param_key, param_value in flattened_params: |
| 161 | +- query_params = query_params.add(param_key, str(param_value)) |
| 162 | ++ if ( |
| 163 | ++ convert_and_respect_annotation_metadata( |
| 164 | ++ object_=session_settings, annotation=ConnectSessionSettings, direction="write" |
| 165 | ++ ) |
| 166 | ++ is not None |
| 167 | ++ ): |
| 168 | ++ query_params = query_params.add( |
| 169 | ++ "session_settings", |
| 170 | ++ convert_and_respect_annotation_metadata( |
| 171 | ++ object_=session_settings, annotation=ConnectSessionSettings, direction="write" |
| 172 | ++ ), |
| 173 | ++ ) |
| 174 | + ws_url = ws_url + f"?{query_params}" |
| 175 | + headers = self._client_wrapper.get_headers() |
| 176 | + if request_options and "additional_headers" in request_options: |
0 commit comments