Skip to content

Commit 1c2bf05

Browse files
MAsuamahAssemblyAI
andauthored
chore: sync sdk code with DeepLearning repo (#172)
Co-authored-by: AssemblyAI <engineering.sdk@assemblyai.com>
1 parent 1397ec1 commit 1c2bf05

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

assemblyai/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.52.2"
1+
__version__ = "0.52.3"

assemblyai/streaming/v3/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
BeginEvent,
44
Encoding,
55
EventMessage,
6+
LLMGatewayResponseEvent,
67
SpeechModel,
78
StreamingClientOptions,
89
StreamingError,
@@ -18,6 +19,7 @@
1819
"BeginEvent",
1920
"Encoding",
2021
"EventMessage",
22+
"LLMGatewayResponseEvent",
2123
"SpeechModel",
2224
"StreamingClient",
2325
"StreamingClientOptions",

assemblyai/streaming/v3/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
ErrorEvent,
1919
EventMessage,
2020
ForceEndpoint,
21+
LLMGatewayResponseEvent,
2122
OperationMessage,
2223
StreamingClientOptions,
2324
StreamingError,
@@ -211,6 +212,8 @@ def _parse_message(self, data: Dict[str, Any]) -> Optional[EventMessage]:
211212
return TerminationEvent.model_validate(data)
212213
elif event_type == StreamingEvents.Turn:
213214
return TurnEvent.model_validate(data)
215+
elif event_type == StreamingEvents.LLMGatewayResponse:
216+
return LLMGatewayResponseEvent.model_validate(data)
214217
else:
215218
return None
216219
elif "error" in data:

assemblyai/streaming/v3/models.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from datetime import datetime
22
from enum import Enum
3-
from typing import List, Literal, Optional, Union
3+
from typing import Any, List, Literal, Optional, Union
44

55
from pydantic import BaseModel
66

@@ -52,11 +52,19 @@ class ErrorEvent(BaseModel):
5252
error: str
5353

5454

55+
class LLMGatewayResponseEvent(BaseModel):
56+
type: Literal["LLMGatewayResponse"] = "LLMGatewayResponse"
57+
turn_order: int
58+
transcript: str
59+
data: Any
60+
61+
5562
EventMessage = Union[
5663
BeginEvent,
5764
TerminationEvent,
5865
TurnEvent,
5966
ErrorEvent,
67+
LLMGatewayResponseEvent,
6068
]
6169

6270

@@ -160,3 +168,4 @@ class StreamingEvents(Enum):
160168
Termination = "Termination"
161169
Turn = "Turn"
162170
Error = "Error"
171+
LLMGatewayResponse = "LLMGatewayResponse"

0 commit comments

Comments
 (0)