Skip to content

Commit abf22e0

Browse files
Merge pull request #316 from dvonthenen/audit-legacy-v2-syntax
Examine Legacy Syntax and Verify/Identify Issues
2 parents 2e948e4 + 450211e commit abf22e0

File tree

35 files changed

+1096
-246
lines changed

35 files changed

+1096
-246
lines changed

deepgram/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
# prerecorded
2929
from .client import PreRecordedClient, AsyncPreRecordedClient
3030
from .client import (
31-
PrerecordedSource,
3231
FileSource,
32+
PrerecordedSource,
3333
UrlSource,
3434
BufferSource,
35-
ReadStreamSource,
35+
StreamSource,
3636
PrerecordedOptions,
3737
Sentiment,
3838
)
@@ -49,7 +49,7 @@
4949
TextSource,
5050
UrlSource,
5151
BufferSource,
52-
AnalyzeStreamSource,
52+
StreamSource,
5353
AnalyzeOptions,
5454
Sentiment,
5555
)

deepgram/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
# prerecorded
3030
from .clients import PreRecordedClient, AsyncPreRecordedClient
3131
from .clients import (
32-
PrerecordedSource,
3332
FileSource,
33+
PrerecordedSource,
3434
UrlSource,
3535
BufferSource,
36-
ReadStreamSource,
36+
StreamSource,
3737
PrerecordedOptions,
3838
Sentiment,
3939
)
@@ -52,7 +52,7 @@
5252
TextSource,
5353
UrlSource,
5454
BufferSource,
55-
AnalyzeStreamSource,
55+
StreamSource,
5656
AnalyzeOptions,
5757
Sentiment,
5858
)

deepgram/clients/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
from .prerecorded import PrerecordedOptions
2424
from .prerecorded import Sentiment
2525
from .prerecorded import (
26-
PrerecordedSource,
2726
FileSource,
27+
PrerecordedSource,
2828
UrlSource,
2929
BufferSource,
30-
ReadStreamSource,
30+
StreamSource,
3131
)
3232
from .prerecorded import (
3333
AsyncPrerecordedResponse,
@@ -44,7 +44,7 @@
4444
TextSource,
4545
UrlSource,
4646
BufferSource,
47-
AnalyzeStreamSource,
47+
StreamSource,
4848
)
4949
from .analyze import (
5050
AsyncAnalyzeResponse,

deepgram/clients/analyze/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
from .client import AnalyzeClient
66
from .client import AsyncAnalyzeClient
77
from .client import AnalyzeOptions
8-
from .client import Sentiment
9-
from .source import (
10-
AnalyzeSource,
11-
TextSource,
8+
from .client import (
129
UrlSource,
1310
BufferSource,
14-
AnalyzeStreamSource,
11+
StreamSource,
12+
AnalyzeSource,
13+
TextSource,
1514
)
15+
from .client import Sentiment
1616
from .client import AsyncAnalyzeResponse, AnalyzeResponse, SyncAnalyzeResponse
1717

1818
from ...options import DeepgramClientOptions

deepgram/clients/analyze/client.py

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22
# Use of this source code is governed by a MIT license that can be found in the LICENSE file.
33
# SPDX-License-Identifier: MIT
44

5+
from typing import Union
6+
57
from .v1.client import AnalyzeClient as AnalyzeClientLatest
68
from .v1.async_client import AsyncAnalyzeClient as AsyncAnalyzeClientLatest
7-
from .v1.options import AnalyzeOptions as AnalyzeOptionsLatest
8-
from .source import AnalyzeSource, TextSource, UrlSource
9+
from .v1.options import (
10+
AnalyzeOptions as AnalyzeOptionsLatest,
11+
StreamSource as StreamSourceLatest,
12+
BufferSource as BufferSourceLatest,
13+
UrlSource as UrlSourceLatest,
14+
AnalyzeSource as AnalyzeSourceLatest,
15+
TextSource as TextSourceLatest,
16+
)
917
from .v1.response import (
1018
SyncAnalyzeResponse as SyncAnalyzeResponseLatest,
1119
AnalyzeResponse as AnalyzeResponseLatest,
@@ -28,6 +36,37 @@ class AnalyzeOptions(AnalyzeOptionsLatest):
2836
pass
2937

3038

39+
class StreamSource(StreamSourceLatest):
40+
"""
41+
Please see StreamSourceLatest for details
42+
"""
43+
44+
pass
45+
46+
47+
class BufferSource(BufferSourceLatest):
48+
"""
49+
Please see BufferSourceLatest for details
50+
"""
51+
52+
pass
53+
54+
55+
class UrlSource(UrlSourceLatest):
56+
"""
57+
Please see UrlSourceLatest for details
58+
"""
59+
60+
pass
61+
62+
63+
AnalyzeSource = AnalyzeSourceLatest
64+
TextSource = TextSourceLatest
65+
66+
67+
# responses
68+
69+
3170
class AsyncAnalyzeResponse(AsyncAnalyzeResponseLatest):
3271
"""
3372
Please see AnalyzeResponseLatest for details

deepgram/clients/analyze/source.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

deepgram/clients/analyze/v1/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
from .client import AnalyzeClient
66
from .async_client import AsyncAnalyzeClient
7-
from .options import AnalyzeOptions
7+
from .options import (
8+
AnalyzeOptions,
9+
UrlSource,
10+
BufferSource,
11+
StreamSource,
12+
TextSource,
13+
AnalyzeSource,
14+
)
815
from ....options import DeepgramClientOptions
916
from .response import AsyncAnalyzeResponse, AnalyzeResponse
1017
from ..enums import Sentiment

0 commit comments

Comments
 (0)