Skip to content

Commit ee4a581

Browse files
Merge pull request #464 from dvonthenen/issue457-expose-all-response-types
Expose All Response Types/Objects
2 parents 78c7c45 + 7973bcb commit ee4a581

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1740
-1287
lines changed

deepgram/__init__.py

Lines changed: 137 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,32 @@
4343
StreamSource,
4444
FileSource,
4545
UrlSource,
46+
)
47+
from .client import BaseResponse
48+
from .client import (
49+
Average,
50+
Intent,
51+
Intents,
52+
IntentsInfo,
53+
Segment,
54+
SentimentInfo,
4655
Sentiment,
56+
Sentiments,
57+
SummaryInfo,
58+
Topic,
59+
Topics,
60+
TopicsInfo,
61+
)
62+
from .client import (
63+
ModelInfo,
64+
Alternative,
65+
Hit,
66+
Search,
67+
Channel,
68+
Word,
4769
)
4870
from .client import (
4971
OpenResponse,
50-
MetadataResponse,
5172
CloseResponse,
5273
UnhandledResponse,
5374
ErrorResponse,
@@ -59,30 +80,77 @@
5980
from .client import LiveTranscriptionEvents
6081
from .client import LiveOptions, ListenWebSocketOptions
6182
from .client import (
62-
# OpenResponse,
83+
#### top level
6384
LiveResultResponse,
64-
# MetadataResponse,
85+
ListenWSMetadataResponse,
6586
SpeechStartedResponse,
6687
UtteranceEndResponse,
88+
#### common websocket response
89+
# OpenResponse,
6790
# CloseResponse,
6891
# UnhandledResponse,
6992
# ErrorResponse,
93+
#### unique
94+
ListenWSMetadata,
7095
)
7196

7297
# prerecorded
7398
from .client import PreRecordedClient, AsyncPreRecordedClient # backward compat
7499
from .client import ListenRESTClient, AsyncListenRESTClient
75100
from .client import (
76-
ListenRESTOptions,
77-
PrerecordedOptions,
101+
# common
102+
# UrlSource,
103+
# BufferSource,
104+
# StreamSource,
105+
# TextSource,
106+
# FileSource,
107+
# unique
78108
PreRecordedStreamSource,
79109
PrerecordedSource,
80110
ListenRestSource,
111+
SpeakRESTSource,
81112
)
82113
from .client import (
114+
ListenRESTOptions,
115+
PrerecordedOptions,
116+
)
117+
from .client import (
118+
#### top level
83119
AsyncPrerecordedResponse,
84120
PrerecordedResponse,
85121
SyncPrerecordedResponse,
122+
#### shared
123+
# Average,
124+
# Intent,
125+
# Intents,
126+
# IntentsInfo,
127+
# Segment,
128+
# SentimentInfo,
129+
# Sentiment,
130+
# Sentiments,
131+
# SummaryInfo,
132+
# Topic,
133+
# Topics,
134+
# TopicsInfo,
135+
#### unique
136+
Alternative,
137+
Channel,
138+
Entity,
139+
Hit,
140+
ListenRESTMetadata,
141+
ModelInfo,
142+
Paragraph,
143+
Paragraphs,
144+
ListenRESTResults,
145+
Search,
146+
Sentence,
147+
Summaries,
148+
SummaryV1,
149+
SummaryV2,
150+
Translation,
151+
Utterance,
152+
Warning,
153+
Word,
86154
)
87155

88156
# read
@@ -94,23 +162,45 @@
94162
AnalyzeSource,
95163
)
96164
from .client import (
165+
#### top level
97166
AsyncAnalyzeResponse,
98-
AnalyzeResponse,
99167
SyncAnalyzeResponse,
168+
AnalyzeResponse,
169+
#### shared
170+
# Average,
171+
# Intent,
172+
# Intents,
173+
# IntentsInfo,
174+
# Segment,
175+
# SentimentInfo,
176+
# Sentiment,
177+
# Sentiments,
178+
# SummaryInfo,
179+
# Topic,
180+
# Topics,
181+
# TopicsInfo,
182+
#### unique
183+
AnalyzeMetadata,
184+
AnalyzeResults,
185+
AnalyzeSummary,
100186
)
101187

102188
# speak
189+
## speak REST
103190
from .client import (
104-
SpeakOptions,
191+
#### top level
105192
SpeakRESTOptions,
106-
SpeakWSOptions,
193+
SpeakOptions, # backward compat
194+
#### common
195+
# TextSource,
196+
# BufferSource,
197+
# StreamSource,
107198
# FileSource,
108-
SpeakRestSource,
199+
#### unique
109200
SpeakSource,
201+
SpeakRestSource,
110202
)
111-
from .client import SpeakWebSocketEvents, SpeakWebSocketMessage
112203

113-
## speak REST
114204
from .client import (
115205
SpeakClient, # backward compat
116206
SpeakRESTClient,
@@ -123,20 +213,29 @@
123213
)
124214

125215
## speak WebSocket
216+
from .client import SpeakWebSocketEvents, SpeakWebSocketMessage
217+
218+
from .client import (
219+
SpeakWSOptions,
220+
)
221+
126222
from .client import (
127223
SpeakWebSocketClient,
128224
AsyncSpeakWebSocketClient,
129225
SpeakWSClient,
130226
AsyncSpeakWSClient,
131227
)
228+
132229
from .client import (
133-
# OpenResponse,
134-
# MetadataResponse,
230+
#### top level
231+
SpeakWSMetadataResponse,
135232
FlushedResponse,
136233
ClearedResponse,
234+
WarningResponse,
235+
#### common websocket response
236+
# OpenResponse,
137237
# CloseResponse,
138238
# UnhandledResponse,
139-
WarningResponse,
140239
# ErrorResponse,
141240
)
142241

@@ -154,23 +253,42 @@
154253

155254
# manage client responses
156255
from .client import (
256+
#### top level
157257
Message,
158-
Project,
159258
ProjectsResponse,
259+
ModelResponse,
260+
ModelsResponse,
160261
MembersResponse,
161-
Key,
162262
KeyResponse,
163263
KeysResponse,
164264
ScopesResponse,
165265
InvitesResponse,
166266
UsageRequest,
267+
UsageResponse,
167268
UsageRequestsResponse,
168269
UsageSummaryResponse,
169270
UsageFieldsResponse,
170-
Balance,
171271
BalancesResponse,
172-
ModelsResponse,
173-
ModelResponse,
272+
#### shared
273+
Project,
274+
STTDetails,
275+
TTSMetadata,
276+
TTSDetails,
277+
Member,
278+
Key,
279+
Invite,
280+
Config,
281+
STTUsageDetails,
282+
Callback,
283+
TokenDetail,
284+
SpeechSegment,
285+
TTSUsageDetails,
286+
STTTokens,
287+
TTSTokens,
288+
UsageSummaryResults,
289+
Resolution,
290+
UsageModel,
291+
Balance,
174292
)
175293

176294
# selfhosted

deepgram/audio/microphone/microphone.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(
4747
chunk: int = CHUNK,
4848
channels: int = CHANNELS,
4949
input_device_index: Optional[int] = None,
50-
):
50+
): # pylint: disable=too-many-positional-arguments
5151
# dynamic import of pyaudio as not to force the requirements on the SDK (and users)
5252
import pyaudio # pylint: disable=import-outside-toplevel
5353

deepgram/audio/speaker/speaker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(
5555
chunk: int = CHUNK,
5656
channels: int = CHANNELS,
5757
output_device_index: Optional[int] = None,
58-
):
58+
): # pylint: disable=too-many-positional-arguments
5959
# dynamic import of pyaudio as not to force the requirements on the SDK (and users)
6060
import pyaudio # pylint: disable=import-outside-toplevel
6161

0 commit comments

Comments
 (0)