Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assemblyai/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.52.2"
__version__ = "0.52.3"
2 changes: 2 additions & 0 deletions assemblyai/streaming/v3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
BeginEvent,
Encoding,
EventMessage,
LLMGatewayResponseEvent,
SpeechModel,
StreamingClientOptions,
StreamingError,
Expand All @@ -18,6 +19,7 @@
"BeginEvent",
"Encoding",
"EventMessage",
"LLMGatewayResponseEvent",
"SpeechModel",
"StreamingClient",
"StreamingClientOptions",
Expand Down
3 changes: 3 additions & 0 deletions assemblyai/streaming/v3/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
ErrorEvent,
EventMessage,
ForceEndpoint,
LLMGatewayResponseEvent,
OperationMessage,
StreamingClientOptions,
StreamingError,
Expand Down Expand Up @@ -211,6 +212,8 @@ def _parse_message(self, data: Dict[str, Any]) -> Optional[EventMessage]:
return TerminationEvent.model_validate(data)
elif event_type == StreamingEvents.Turn:
return TurnEvent.model_validate(data)
elif event_type == StreamingEvents.LLMGatewayResponse:
return LLMGatewayResponseEvent.model_validate(data)
else:
return None
elif "error" in data:
Expand Down
11 changes: 10 additions & 1 deletion assemblyai/streaming/v3/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import datetime
from enum import Enum
from typing import List, Literal, Optional, Union
from typing import Any, List, Literal, Optional, Union

from pydantic import BaseModel

Expand Down Expand Up @@ -52,11 +52,19 @@ class ErrorEvent(BaseModel):
error: str


class LLMGatewayResponseEvent(BaseModel):
type: Literal["LLMGatewayResponse"] = "LLMGatewayResponse"
turn_order: int
transcript: str
data: Any


EventMessage = Union[
BeginEvent,
TerminationEvent,
TurnEvent,
ErrorEvent,
LLMGatewayResponseEvent,
]


Expand Down Expand Up @@ -160,3 +168,4 @@ class StreamingEvents(Enum):
Termination = "Termination"
Turn = "Turn"
Error = "Error"
LLMGatewayResponse = "LLMGatewayResponse"