Skip to content

Commit c70fedc

Browse files
committed
Add .diff files for fern-ignored files
1 parent acbf492 commit c70fedc

File tree

8 files changed

+1598
-0
lines changed

8 files changed

+1598
-0
lines changed

src/hume/empathic_voice/chat/client.py.diff

Lines changed: 422 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
diff --git a/var/folders/5_/tlgrkrq92pv1mxbrp9y7v3h80000gn/T/fern-generate-zKcOwT/hume-python-sdk/src/hume/empathic_voice/chat/raw_client.py b/Users/twitchard/dev/fern-config/fern/apis/unioned/.preview/fern-python-sdk/src/hume/empathic_voice/chat/raw_client.py
2+
index fefee870..ed718e98 100644
3+
--- a/var/folders/5_/tlgrkrq92pv1mxbrp9y7v3h80000gn/T/fern-generate-zKcOwT/hume-python-sdk/src/hume/empathic_voice/chat/raw_client.py
4+
+++ b/Users/twitchard/dev/fern-config/fern/apis/unioned/.preview/fern-python-sdk/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,6 +50,9 @@ 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+
@@ -103,6 +106,8 @@ class RawChatClient:
32+
query_params = httpx.QueryParams()
33+
if access_token is not None:
34+
query_params = query_params.add("access_token", access_token)
35+
+ if allow_connection is not None:
36+
+ query_params = query_params.add("allow_connection", allow_connection)
37+
if config_id is not None:
38+
query_params = query_params.add("config_id", config_id)
39+
if config_version is not None:
40+
@@ -115,10 +120,18 @@ class RawChatClient:
41+
query_params = query_params.add("verbose_transcription", verbose_transcription)
42+
if api_key is not None:
43+
query_params = query_params.add("api_key", api_key)
44+
- if session_settings is not None:
45+
- flattened_params = single_query_encoder("session_settings", session_settings)
46+
- for param_key, param_value in flattened_params:
47+
- query_params = query_params.add(param_key, str(param_value))
48+
+ if (
49+
+ convert_and_respect_annotation_metadata(
50+
+ object_=session_settings, annotation=ConnectSessionSettings, direction="write"
51+
+ )
52+
+ is not None
53+
+ ):
54+
+ query_params = query_params.add(
55+
+ "session_settings",
56+
+ convert_and_respect_annotation_metadata(
57+
+ object_=session_settings, annotation=ConnectSessionSettings, direction="write"
58+
+ ),
59+
+ )
60+
ws_url = ws_url + f"?{query_params}"
61+
headers = self._client_wrapper.get_headers()
62+
if request_options and "additional_headers" in request_options:
63+
@@ -150,6 +163,7 @@ class AsyncRawChatClient:
64+
self,
65+
*,
66+
access_token: typing.Optional[str] = None,
67+
+ allow_connection: typing.Optional[bool] = None,
68+
config_id: typing.Optional[str] = None,
69+
config_version: typing.Optional[int] = None,
70+
event_limit: typing.Optional[int] = None,
71+
@@ -171,6 +185,9 @@ class AsyncRawChatClient:
72+
73+
For more details, refer to the [Authentication Strategies Guide](/docs/introduction/api-key#authentication-strategies).
74+
75+
+ allow_connection : typing.Optional[bool]
76+
+ Allows external connections to this chat via the /connect endpoint.
77+
+
78+
config_id : typing.Optional[str]
79+
The unique identifier for an EVI configuration.
80+
81+
@@ -224,6 +241,8 @@ class AsyncRawChatClient:
82+
query_params = httpx.QueryParams()
83+
if access_token is not None:
84+
query_params = query_params.add("access_token", access_token)
85+
+ if allow_connection is not None:
86+
+ query_params = query_params.add("allow_connection", allow_connection)
87+
if config_id is not None:
88+
query_params = query_params.add("config_id", config_id)
89+
if config_version is not None:
90+
@@ -236,10 +255,18 @@ class AsyncRawChatClient:
91+
query_params = query_params.add("verbose_transcription", verbose_transcription)
92+
if api_key is not None:
93+
query_params = query_params.add("api_key", api_key)
94+
- if session_settings is not None:
95+
- flattened_params = single_query_encoder("session_settings", session_settings)
96+
- for param_key, param_value in flattened_params:
97+
- query_params = query_params.add(param_key, str(param_value))
98+
+ if (
99+
+ convert_and_respect_annotation_metadata(
100+
+ object_=session_settings, annotation=ConnectSessionSettings, direction="write"
101+
+ )
102+
+ is not None
103+
+ ):
104+
+ query_params = query_params.add(
105+
+ "session_settings",
106+
+ convert_and_respect_annotation_metadata(
107+
+ object_=session_settings, annotation=ConnectSessionSettings, direction="write"
108+
+ ),
109+
+ )
110+
ws_url = ws_url + f"?{query_params}"
111+
headers = self._client_wrapper.get_headers()
112+
if request_options and "additional_headers" in request_options:
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
diff --git a/var/folders/5_/tlgrkrq92pv1mxbrp9y7v3h80000gn/T/fern-generate-zKcOwT/hume-python-sdk/src/hume/empathic_voice/chat/socket_client.py b/Users/twitchard/dev/fern-config/fern/apis/unioned/.preview/fern-python-sdk/src/hume/empathic_voice/chat/socket_client.py
2+
index de3b4a5e..18ee74ab 100644
3+
--- a/var/folders/5_/tlgrkrq92pv1mxbrp9y7v3h80000gn/T/fern-generate-zKcOwT/hume-python-sdk/src/hume/empathic_voice/chat/socket_client.py
4+
+++ b/Users/twitchard/dev/fern-config/fern/apis/unioned/.preview/fern-python-sdk/src/hume/empathic_voice/chat/socket_client.py
5+
@@ -6,21 +6,10 @@ from json.decoder import JSONDecodeError
6+
7+
import websockets
8+
import websockets.sync.connection as websockets_sync_connection
9+
-from typing_extensions import deprecated
10+
-from contextlib import asynccontextmanager
11+
-
12+
from ...core.events import EventEmitterMixin, EventType
13+
from ...core.pydantic_utilities import parse_obj_as
14+
-from ..types.assistant_input import AssistantInput
15+
-from ..types.audio_input import AudioInput
16+
-from ..types.pause_assistant_message import PauseAssistantMessage
17+
-from ..types.resume_assistant_message import ResumeAssistantMessage
18+
-from ..types.session_settings import SessionSettings
19+
-from ..types.tool_error_message import ToolErrorMessage
20+
-from ..types.tool_response_message import ToolResponseMessage
21+
-from ..types.user_input import UserInput
22+
-from .types.publish_event import PublishEvent
23+
from ..types.subscribe_event import SubscribeEvent
24+
+from .types.publish_event import PublishEvent
25+
26+
try:
27+
from websockets.legacy.client import WebSocketClientProtocol # type: ignore
28+
@@ -29,58 +18,6 @@ except ImportError:
29+
30+
ChatSocketClientResponse = typing.Union[SubscribeEvent]
31+
32+
-class ChatConnectSessionSettingsAudio(typing.TypedDict, total=False):
33+
- channels: typing.Optional[int]
34+
- encoding: typing.Optional[str]
35+
- sample_rate: typing.Optional[int]
36+
-
37+
-
38+
-class ChatConnectSessionSettingsContext(typing.TypedDict, total=False):
39+
- text: typing.Optional[str]
40+
-
41+
-
42+
-SessionSettingsVariablesValue = typing.Union[str, float, bool]
43+
-
44+
-class ChatConnectSessionSettings(typing.TypedDict, total=False):
45+
- audio: typing.Optional[ChatConnectSessionSettingsAudio]
46+
- context: typing.Optional[ChatConnectSessionSettingsContext]
47+
- custom_session_id: typing.Optional[str]
48+
- event_limit: typing.Optional[int]
49+
- language_model_api_key: typing.Optional[str]
50+
- system_prompt: typing.Optional[str]
51+
- variables: typing.Optional[typing.Dict[str, SessionSettingsVariablesValue]]
52+
- voice_id: typing.Optional[str]
53+
-
54+
-@deprecated("Use .connect() with kwargs instead.")
55+
-class ChatConnectOptions(typing.TypedDict, total=False):
56+
- config_id: typing.Optional[str]
57+
- """
58+
- The ID of the configuration.
59+
- """
60+
-
61+
- config_version: typing.Optional[str]
62+
- """
63+
- The version of the configuration.
64+
- """
65+
-
66+
- api_key: typing.Optional[str]
67+
-
68+
- secret_key: typing.Optional[str]
69+
-
70+
- resumed_chat_group_id: typing.Optional[str]
71+
-
72+
- verbose_transcription: typing.Optional[bool]
73+
-
74+
- """
75+
- ID of the Voice to use for this chat. If specified, will override the voice set in the Config
76+
- """
77+
- voice_id: typing.Optional[str]
78+
-
79+
- session_settings: typing.Optional[typing.Dict]
80+
- """
81+
- Session settings to apply at connection time. Supports all SessionSettings fields except
82+
- builtin_tools, type, metadata, and tools. Additionally supports event_limit.
83+
- """
84+
85+
class AsyncChatSocketClient(EventEmitterMixin):
86+
def __init__(self, *, websocket: WebSocketClientProtocol):
87+
@@ -141,38 +78,6 @@ class AsyncChatSocketClient(EventEmitterMixin):
88+
"""
89+
await self._send(data.dict())
90+
91+
- @deprecated("Use send_publish instead.")
92+
- async def send_audio_input(self, message: AudioInput) -> None:
93+
- await self.send_publish(message)
94+
-
95+
- @deprecated("Use send_publish instead.")
96+
- async def send_session_settings(self, message: SessionSettings) -> None:
97+
- await self.send_publish(message)
98+
-
99+
- @deprecated("Use send_publish instead.")
100+
- async def send_user_input(self, message: UserInput) -> None:
101+
- await self.send_publish(message)
102+
-
103+
- @deprecated("Use send_publish instead.")
104+
- async def send_assistant_input(self, message: AssistantInput) -> None:
105+
- await self.send_publish(message)
106+
-
107+
- @deprecated("Use send_publish instead.")
108+
- async def send_tool_response(self, message: ToolResponseMessage) -> None:
109+
- await self.send_publish(message)
110+
-
111+
- @deprecated("Use send_publish instead.")
112+
- async def send_tool_error(self, message: ToolErrorMessage) -> None:
113+
- await self.send_publish(message)
114+
-
115+
- @deprecated("Use send_publish instead.")
116+
- async def send_pause_assistant(self, message: PauseAssistantMessage) -> None:
117+
- await self.send_publish(message)
118+
-
119+
- @deprecated("Use send_publish instead.")
120+
- async def send_resume_assistant(self, message: ResumeAssistantMessage) -> None:
121+
- await self.send_publish(message)
122+
-
123+
124+
class ChatSocketClient(EventEmitterMixin):
125+
def __init__(self, *, websocket: websockets_sync_connection.Connection):
126+
@@ -232,35 +137,3 @@ class ChatSocketClient(EventEmitterMixin):
127+
Send a Pydantic model to the websocket connection.
128+
"""
129+
self._send(data.dict())
130+
-
131+
- @deprecated("Use send_publish instead.")
132+
- def send_audio_input(self, message: AudioInput) -> None:
133+
- self.send_publish(message)
134+
-
135+
- @deprecated("Use send_publish instead.")
136+
- def send_session_settings(self, message: SessionSettings) -> None:
137+
- self.send_publish(message)
138+
-
139+
- @deprecated("Use send_publish instead.")
140+
- def send_user_input(self, message: UserInput) -> None:
141+
- self.send_publish(message)
142+
-
143+
- @deprecated("Use send_publish instead.")
144+
- def send_assistant_input(self, message: AssistantInput) -> None:
145+
- self.send_publish(message)
146+
-
147+
- @deprecated("Use send_publish instead.")
148+
- def send_tool_response(self, message: ToolResponseMessage) -> None:
149+
- self.send_publish(message)
150+
-
151+
- @deprecated("Use send_publish instead.")
152+
- def send_tool_error(self, message: ToolErrorMessage) -> None:
153+
- self.send_publish(message)
154+
-
155+
- @deprecated("Use send_publish instead.")
156+
- def send_pause_assistant(self, message: PauseAssistantMessage) -> None:
157+
- self.send_publish(message)
158+
-
159+
- @deprecated("Use send_publish instead.")
160+
- def send_resume_assistant(self, message: ResumeAssistantMessage) -> None:
161+
- self.send_publish(message)

0 commit comments

Comments
 (0)