|
55 | 55 | ) |
56 | 56 |
|
57 | 57 | # listen client |
58 | | -from .clients import Listen, Read, Speak |
| 58 | +from .clients import ListenRouter, ReadRouter, SpeakRouter, AgentRouter |
59 | 59 |
|
60 | 60 | # speech-to-text |
61 | 61 | from .clients import LiveClient, AsyncLiveClient # backward compat |
|
308 | 308 | AsyncSelfHostedClient, |
309 | 309 | ) |
310 | 310 |
|
| 311 | + |
| 312 | +# agent |
| 313 | +from .clients import AgentWebSocketEvents |
| 314 | + |
| 315 | +# websocket |
| 316 | +from .clients import ( |
| 317 | + AgentWebSocketClient, |
| 318 | + AsyncAgentWebSocketClient, |
| 319 | +) |
| 320 | + |
| 321 | +from .clients import ( |
| 322 | + #### common websocket response |
| 323 | + # OpenResponse, |
| 324 | + # CloseResponse, |
| 325 | + # ErrorResponse, |
| 326 | + # UnhandledResponse, |
| 327 | + #### unique |
| 328 | + WelcomeResponse, |
| 329 | + SettingsAppliedResponse, |
| 330 | + ConversationTextResponse, |
| 331 | + UserStartedSpeakingResponse, |
| 332 | + AgentThinkingResponse, |
| 333 | + FunctionCalling, |
| 334 | + FunctionCallRequest, |
| 335 | + AgentStartedSpeakingResponse, |
| 336 | + AgentAudioDoneResponse, |
| 337 | + InjectionRefusedResponse, |
| 338 | +) |
| 339 | + |
| 340 | +from .clients import ( |
| 341 | + # top level |
| 342 | + SettingsConfigurationOptions, |
| 343 | + UpdateInstructionsOptions, |
| 344 | + UpdateSpeakOptions, |
| 345 | + InjectAgentMessageOptions, |
| 346 | + FunctionCallResponse, |
| 347 | + AgentKeepAlive, |
| 348 | + # sub level |
| 349 | + Listen, |
| 350 | + Speak, |
| 351 | + Header, |
| 352 | + Item, |
| 353 | + Properties, |
| 354 | + Parameters, |
| 355 | + Function, |
| 356 | + Provider, |
| 357 | + Think, |
| 358 | + Agent, |
| 359 | + Input, |
| 360 | + Output, |
| 361 | + Audio, |
| 362 | + Context, |
| 363 | +) |
| 364 | + |
| 365 | + |
311 | 366 | # client errors and options |
312 | 367 | from .options import DeepgramClientOptions, ClientOptionsFromEnv |
313 | 368 | from .errors import DeepgramApiKeyError |
@@ -397,21 +452,21 @@ def listen(self): |
397 | 452 | """ |
398 | 453 | Returns a Listen dot-notation router for interacting with Deepgram's transcription services. |
399 | 454 | """ |
400 | | - return Listen(self._config) |
| 455 | + return ListenRouter(self._config) |
401 | 456 |
|
402 | 457 | @property |
403 | 458 | def read(self): |
404 | 459 | """ |
405 | 460 | Returns a Read dot-notation router for interacting with Deepgram's read services. |
406 | 461 | """ |
407 | | - return Read(self._config) |
| 462 | + return ReadRouter(self._config) |
408 | 463 |
|
409 | 464 | @property |
410 | 465 | def speak(self): |
411 | 466 | """ |
412 | 467 | Returns a Speak dot-notation router for interacting with Deepgram's speak services. |
413 | 468 | """ |
414 | | - return Speak(self._config) |
| 469 | + return SpeakRouter(self._config) |
415 | 470 |
|
416 | 471 | @property |
417 | 472 | @deprecation.deprecated( |
@@ -480,6 +535,13 @@ def asyncselfhosted(self): |
480 | 535 | """ |
481 | 536 | return self.Version(self._config, "asyncselfhosted") |
482 | 537 |
|
| 538 | + @property |
| 539 | + def agent(self): |
| 540 | + """ |
| 541 | + Returns a Agent dot-notation router for interacting with Deepgram's speak services. |
| 542 | + """ |
| 543 | + return AgentRouter(self._config) |
| 544 | + |
483 | 545 | # INTERNAL CLASSES |
484 | 546 | class Version: |
485 | 547 | """ |
|
0 commit comments