Skip to content

Commit

Permalink
[HOLD] Reintroduce TTS WS
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvonthenen committed Aug 6, 2024
1 parent 78ec6d9 commit afa5d60
Show file tree
Hide file tree
Showing 17 changed files with 1,875 additions and 98 deletions.
32 changes: 16 additions & 16 deletions deepgram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
from .client import (
SpeakOptions,
SpeakRESTOptions,
# SpeakWebSocketOptions,
SpeakWebSocketOptions,
# FileSource,
SpeakRestSource,
SpeakSource,
Expand All @@ -115,21 +115,21 @@
SpeakRESTResponse,
)

# ## speak WebSocket
# from .client import (
# SpeakWebSocketClient,
# AsyncSpeakWebSocketClient,
# )
# from .client import (
# SpeakWebSocketResponse,
# # OpenResponse,
# # MetadataResponse,
# FlushedResponse,
# # CloseResponse,
# # UnhandledResponse,
# WarningResponse,
# # ErrorResponse,
# )
## speak WebSocket
from .client import (
SpeakWebSocketClient,
AsyncSpeakWebSocketClient,
)
from .client import (
SpeakWebSocketResponse,
# OpenResponse,
# MetadataResponse,
FlushedResponse,
# CloseResponse,
# UnhandledResponse,
WarningResponse,
# ErrorResponse,
)

# manage
from .client import ManageClient, AsyncManageClient
Expand Down
32 changes: 16 additions & 16 deletions deepgram/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
from .clients import (
SpeakOptions,
SpeakRESTOptions,
# SpeakWebSocketOptions,
SpeakWebSocketOptions,
# FileSource,
SpeakRestSource,
SpeakSource,
Expand All @@ -119,21 +119,21 @@
SpeakRESTResponse,
)

# ## speak WebSocket
# from .clients import (
# SpeakWebSocketClient,
# AsyncSpeakWebSocketClient,
# )
# from .clients import (
# SpeakWebSocketResponse,
# # OpenResponse,
# # MetadataResponse,
# FlushedResponse,
# # CloseResponse,
# # UnhandledResponse,
# WarningResponse,
# # ErrorResponse,
# )
## speak WebSocket
from .clients import (
SpeakWebSocketClient,
AsyncSpeakWebSocketClient,
)
from .clients import (
SpeakWebSocketResponse,
# OpenResponse,
# MetadataResponse,
FlushedResponse,
# CloseResponse,
# UnhandledResponse,
WarningResponse,
# ErrorResponse,
)

# manage client classes/input
from .clients import ManageClient, AsyncManageClient
Expand Down
32 changes: 16 additions & 16 deletions deepgram/clients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
from .speak import (
SpeakOptions,
SpeakRESTOptions,
# SpeakWebSocketOptions,
SpeakWebSocketOptions,
# FileSource,
SpeakRestSource,
SpeakSource,
Expand All @@ -125,21 +125,21 @@
SpeakRESTResponse,
)

# ## text-to-speech WebSocket
# from .speak import (
# SpeakWebSocketClient,
# AsyncSpeakWebSocketClient,
# )
# from .speak import (
# SpeakWebSocketResponse,
# # OpenResponse,
# # MetadataResponse,
# FlushedResponse,
# # CloseResponse,
# # UnhandledResponse,
# WarningResponse,
# # ErrorResponse,
# )
## text-to-speech WebSocket
from .speak import (
SpeakWebSocketClient,
AsyncSpeakWebSocketClient,
)
from .speak import (
SpeakWebSocketResponse,
# OpenResponse,
# MetadataResponse,
FlushedResponse,
# CloseResponse,
# UnhandledResponse,
WarningResponse,
# ErrorResponse,
)

# manage
from .manage import ManageClient, AsyncManageClient
Expand Down
22 changes: 11 additions & 11 deletions deepgram/clients/speak/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
SpeakClient, # backward compat
SpeakRESTClient,
AsyncSpeakRESTClient,
# SpeakWebSocketClient,
# AsyncSpeakWebSocketClient,
SpeakWebSocketClient,
AsyncSpeakWebSocketClient,
)
from .client import (
SpeakOptions,
SpeakRESTOptions,
# SpeakWebSocketOptions,
SpeakWebSocketOptions,
FileSource,
SpeakRestSource,
SpeakSource,
)
from .client import (
SpeakResponse, # backward compat
SpeakRESTResponse,
# SpeakWebSocketResponse,
# OpenResponse,
# MetadataResponse,
# FlushedResponse,
# CloseResponse,
# UnhandledResponse,
# WarningResponse,
# ErrorResponse,
SpeakWebSocketResponse,
OpenResponse,
MetadataResponse,
FlushedResponse,
CloseResponse,
UnhandledResponse,
WarningResponse,
ErrorResponse,
)
44 changes: 22 additions & 22 deletions deepgram/clients/speak/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
from .v1 import (
SpeakRESTClient as SpeakRESTClientLatest,
AsyncSpeakRESTClient as AsyncSpeakRESTClientLatest,
# SpeakWebSocketClient as SpeakWebSocketClientLatest,
# AsyncSpeakWebSocketClient as AsyncSpeakWebSocketClientLatest,
SpeakWebSocketClient as SpeakWebSocketClientLatest,
AsyncSpeakWebSocketClient as AsyncSpeakWebSocketClientLatest,
)
from .v1 import (
SpeakOptions as SpeakOptionsLatest,
SpeakRESTOptions as SpeakRESTOptionsLatest,
# SpeakWebSocketOptions as SpeakWebSocketOptionsLatest,
SpeakWebSocketOptions as SpeakWebSocketOptionsLatest,
FileSource as FileSourceLatest,
SpeakRestSource as SpeakRestSourceLatest,
SpeakSource as SpeakSourceLatest,
)
from .v1 import (
SpeakRESTResponse as SpeakRESTResponseLatest,
# SpeakWebSocketResponse as SpeakWebSocketResponseLatest,
# OpenResponse as OpenResponseLatest,
# MetadataResponse as MetadataResponseLatest,
# FlushedResponse as FlushedResponseLatest,
# CloseResponse as CloseResponseLatest,
# UnhandledResponse as UnhandledResponseLatest,
# WarningResponse as WarningResponseLatest,
# ErrorResponse as ErrorResponseLatest,
SpeakWebSocketResponse as SpeakWebSocketResponseLatest,
OpenResponse as OpenResponseLatest,
MetadataResponse as MetadataResponseLatest,
FlushedResponse as FlushedResponseLatest,
CloseResponse as CloseResponseLatest,
UnhandledResponse as UnhandledResponseLatest,
WarningResponse as WarningResponseLatest,
ErrorResponse as ErrorResponseLatest,
)

# The client.py points to the current supported version in the SDK.
Expand All @@ -35,21 +35,21 @@
# input
SpeakOptions = SpeakOptionsLatest
SpeakRESTOptions = SpeakRESTOptionsLatest
# SpeakWebSocketOptions = SpeakWebSocketOptionsLatest
SpeakWebSocketOptions = SpeakWebSocketOptionsLatest
SpeakRestSource = SpeakRestSourceLatest
FileSource = FileSourceLatest
SpeakSource = SpeakSourceLatest

# output
SpeakRESTResponse = SpeakRESTResponseLatest
# SpeakWebSocketResponse = SpeakWebSocketResponseLatest
# OpenResponse = OpenResponseLatest
# MetadataResponse = MetadataResponseLatest
# FlushedResponse = FlushedResponseLatest
# CloseResponse = CloseResponseLatest
# UnhandledResponse = UnhandledResponseLatest
# WarningResponse = WarningResponseLatest
# ErrorResponse = ErrorResponseLatest
SpeakWebSocketResponse = SpeakWebSocketResponseLatest
OpenResponse = OpenResponseLatest
MetadataResponse = MetadataResponseLatest
FlushedResponse = FlushedResponseLatest
CloseResponse = CloseResponseLatest
UnhandledResponse = UnhandledResponseLatest
WarningResponse = WarningResponseLatest
ErrorResponse = ErrorResponseLatest


# backward compatibility
Expand All @@ -59,5 +59,5 @@
# clients
SpeakRESTClient = SpeakRESTClientLatest
AsyncSpeakRESTClient = AsyncSpeakRESTClientLatest
# SpeakWebSocketClient = SpeakWebSocketClientLatest
# AsyncSpeakWebSocketClient = AsyncSpeakWebSocketClientLatest
SpeakWebSocketClient = SpeakWebSocketClientLatest
AsyncSpeakWebSocketClient = AsyncSpeakWebSocketClientLatest
31 changes: 15 additions & 16 deletions deepgram/clients/speak/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,25 @@
SpeakSource,
FileSource,
)

# from .websocket import (
# SpeakWebSocketOptions,
# )
from .websocket import (
SpeakWebSocketOptions,
)
from ....options import DeepgramClientOptions, ClientOptionsFromEnv

# rest
from .rest import SpeakRESTClient, AsyncSpeakRESTClient

from .rest import SpeakRESTResponse

# # websocket
# from .websocket import SpeakWebSocketClient, AsyncSpeakWebSocketClient
# from .websocket import (
# SpeakWebSocketResponse,
# OpenResponse,
# MetadataResponse,
# FlushedResponse,
# CloseResponse,
# UnhandledResponse,
# WarningResponse,
# ErrorResponse,
# )
# websocket
from .websocket import SpeakWebSocketClient, AsyncSpeakWebSocketClient
from .websocket import (
SpeakWebSocketResponse,
OpenResponse,
MetadataResponse,
FlushedResponse,
CloseResponse,
UnhandledResponse,
WarningResponse,
ErrorResponse,
)
17 changes: 17 additions & 0 deletions deepgram/clients/speak/v1/websocket/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 Deepgram SDK contributors. All Rights Reserved.
# Use of this source code is governed by a MIT license that can be found in the LICENSE file.
# SPDX-License-Identifier: MIT

from .client import SpeakWebSocketClient
from .async_client import AsyncSpeakWebSocketClient
from .response import (
SpeakWebSocketResponse,
OpenResponse,
MetadataResponse,
FlushedResponse,
CloseResponse,
UnhandledResponse,
WarningResponse,
ErrorResponse,
)
from .options import SpeakWebSocketOptions
Loading

0 comments on commit afa5d60

Please sign in to comment.