Skip to content

Commit 1397ec1

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

File tree

3 files changed

+16
-2
lines changed

3 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.1"
1+
__version__ = "0.52.2"

assemblyai/streaming/v3/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ def __init__(self, options: StreamingClientOptions):
7373
def connect(self, params: StreamingParameters) -> None:
7474
params_dict = _dump_model(params)
7575

76-
# JSON-encode list parameters for proper API compatibility (e.g., keyterms_prompt)
76+
# JSON-encode list and dict parameters for proper API compatibility (e.g., keyterms_prompt, llm_gateway)
7777
for key, value in params_dict.items():
7878
if isinstance(value, list):
7979
params_dict[key] = json.dumps(value)
80+
elif isinstance(value, dict):
81+
params_dict[key] = json.dumps(value)
8082

8183
params_encoded = urlencode(params_dict)
8284

assemblyai/streaming/v3/models.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
from pydantic import BaseModel
66

77

8+
class LLMGatewayMessage(BaseModel):
9+
role: str
10+
content: str
11+
12+
13+
class LLMGatewayConfig(BaseModel):
14+
model: str
15+
messages: List["LLMGatewayMessage"]
16+
max_tokens: int
17+
18+
819
class Word(BaseModel):
920
start: int
1021
end: int
@@ -94,6 +105,7 @@ class StreamingParameters(StreamingSessionParameters):
94105
webhook_url: Optional[str] = None
95106
webhook_auth_header_name: Optional[str] = None
96107
webhook_auth_header_value: Optional[str] = None
108+
llm_gateway: Optional[LLMGatewayConfig] = None
97109

98110

99111
class UpdateConfiguration(StreamingSessionParameters):

0 commit comments

Comments
 (0)