-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adds TTS streaming clients #424
Conversation
WalkthroughThe recent enhancements to the Deepgram codebase involve the introduction of new classes for handling real-time speech synthesis via WebSockets. This includes the addition of Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai review |
Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 15
Outside diff range and nitpick comments (1)
deepgram/clients/speak/__init__.py (1)
Line range hint
6-16
: Consider declaring imported modules in__all__
to avoid unused import warnings.Similar to the previous file, these imports are flagged as unused. If these modules are intended for external use, adding them to the
__all__
list can clarify their purpose and prevent linting errors.+ __all__ = ['SpeakStreamClient', 'AsyncSpeakStreamClient', 'SpeakStreamEvents']
Tools
Ruff
5-5:
.client.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
7-7:
.client.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
8-8:
.client.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.client.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (13)
- deepgram/init.py (1 hunks)
- deepgram/client.py (5 hunks)
- deepgram/clients/init.py (1 hunks)
- deepgram/clients/speak/init.py (2 hunks)
- deepgram/clients/speak/client.py (2 hunks)
- deepgram/clients/speak/enums.py (1 hunks)
- deepgram/clients/speak/errors.py (1 hunks)
- deepgram/clients/speak/v1/init.py (1 hunks)
- deepgram/clients/speak/v1/async_client_stream.py (1 hunks)
- deepgram/clients/speak/v1/client_stream.py (1 hunks)
- deepgram/clients/speak/v1/response.py (1 hunks)
- examples/speak-stream/async-interactive/main.py (1 hunks)
- examples/speak-stream/interactive/main.py (1 hunks)
Files skipped from review due to trivial changes (2)
- deepgram/clients/speak/enums.py
- deepgram/clients/speak/errors.py
Additional context used
Ruff
deepgram/clients/speak/v1/__init__.py
5-5:
.client.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client_stream.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
7-7:
.async_client_stream.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
8-8:
.async_client.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.options.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.options.FileSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.options.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.options.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
10-10:
.response.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
....options.DeepgramClientOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
....options.ClientOptionsFromEnv
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/clients/speak/__init__.py
5-5:
.client.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
7-7:
.client.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
8-8:
.client.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.client.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
11-11:
.client.FileSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
.client.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
13-13:
.client.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
16-16:
.enums.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
17-17:
...options.DeepgramClientOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
17-17:
...options.ClientOptionsFromEnv
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/clients/__init__.py
7-7:
.common.TextSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
8-8:
.common.BufferSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.common.StreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
10-10:
.common.FileSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
11-11:
.common.UrlSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
.common.Sentiment
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
16-16:
.listen.Listen
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
17-17:
.read.Read
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
20-20:
.live.LiveClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
20-20:
.live.AsyncLiveClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
21-21:
.live.LiveOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
22-22:
.live.LiveTranscriptionEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
24-24:
.live.OpenResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
25-25:
.live.LiveResultResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
26-26:
.live.MetadataResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
27-27:
.live.SpeechStartedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
28-28:
.live.UtteranceEndResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
29-29:
.live.CloseResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
30-30:
.live.ErrorResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
31-31:
.live.UnhandledResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
35-35:
.prerecorded.PreRecordedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
35-35:
.prerecorded.AsyncPreRecordedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
36-36:
.prerecorded.PrerecordedOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
38-38:
.prerecorded.PreRecordedStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
39-39:
.prerecorded.PrerecordedSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
42-42:
.prerecorded.AsyncPrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
43-43:
.prerecorded.PrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
44-44:
.prerecorded.SyncPrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
48-48:
.analyze.ReadClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
48-48:
.analyze.AsyncReadClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
49-49:
.analyze.AnalyzeClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
49-49:
.analyze.AsyncAnalyzeClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
50-50:
.analyze.AnalyzeOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
52-52:
.analyze.AnalyzeStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
53-53:
.analyze.AnalyzeSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
56-56:
.analyze.AsyncAnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
57-57:
.analyze.AnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
58-58:
.analyze.SyncAnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
62-62:
.speak.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
62-62:
.speak.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
63-63:
.speak.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
65-65:
.speak.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
66-66:
.speak.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
68-68:
.speak.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
69-69:
.speak.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.speak.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.speak.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
75-75:
.manage.ManageClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
75-75:
.manage.AsyncManageClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
77-77:
.manage.ProjectOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
78-78:
.manage.KeyOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
79-79:
.manage.ScopeOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
80-80:
.manage.InviteOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
81-81:
.manage.UsageRequestOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
82-82:
.manage.UsageSummaryOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
83-83:
.manage.UsageFieldsOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
86-86:
.manage.Message
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.manage.Project
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
88-88:
.manage.ProjectsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
89-89:
.manage.MembersResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
90-90:
.manage.Key
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
91-91:
.manage.KeyResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
92-92:
.manage.KeysResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
93-93:
.manage.ScopesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
94-94:
.manage.InvitesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
95-95:
.manage.UsageRequest
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
96-96:
.manage.UsageRequestsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
97-97:
.manage.UsageSummaryResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
98-98:
.manage.UsageFieldsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
99-99:
.manage.Balance
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
100-100:
.manage.BalancesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
105-105:
.selfhosted.OnPremClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
106-106:
.selfhosted.AsyncOnPremClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
107-107:
.selfhosted.SelfHostedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
108-108:
.selfhosted.AsyncSelfHostedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/__init__.py
9-9:
logging
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
10-10:
.utils.VerboseLogger
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
.utils.NOTICE
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
13-13:
.utils.SPAM
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
14-14:
.utils.SUCCESS
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
15-15:
.utils.VERBOSE
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
16-16:
.utils.WARNING
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
17-17:
.utils.ERROR
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
18-18:
.utils.FATAL
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
19-19:
.utils.CRITICAL
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
20-20:
.utils.INFO
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
21-21:
.utils.DEBUG
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
22-22:
.utils.NOTSET
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
25-25:
.client.Deepgram
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
25-25:
.client.DeepgramClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
26-26:
.client.DeepgramClientOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
26-26:
.client.ClientOptionsFromEnv
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
27-27:
.client.DeepgramApiKeyError
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
27-27:
.client.DeepgramModuleError
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
30-30:
.client.Listen
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
30-30:
.client.Read
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
34-34:
.client.TextSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
35-35:
.client.BufferSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
36-36:
.client.StreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
37-37:
.client.FileSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
38-38:
.client.UrlSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
39-39:
.client.Sentiment
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
43-43:
.client.LiveTranscriptionEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
44-44:
.client.LiveClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
44-44:
.client.AsyncLiveClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
45-45:
.client.LiveOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
47-47:
.client.OpenResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
48-48:
.client.LiveResultResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
49-49:
.client.MetadataResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
50-50:
.client.SpeechStartedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
51-51:
.client.UtteranceEndResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
52-52:
.client.CloseResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
53-53:
.client.UnhandledResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
54-54:
.client.ErrorResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
58-58:
.client.PreRecordedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
58-58:
.client.AsyncPreRecordedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
60-60:
.client.PrerecordedOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
61-61:
.client.PreRecordedStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
62-62:
.client.PrerecordedSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
65-65:
.client.AsyncPrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
66-66:
.client.PrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
67-67:
.client.SyncPrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
71-71:
.client.ReadClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
71-71:
.client.AsyncReadClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.client.AnalyzeClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.client.AsyncAnalyzeClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
74-74:
.client.AnalyzeOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
75-75:
.client.AnalyzeStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
76-76:
.client.AnalyzeSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
79-79:
.client.AsyncAnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
80-80:
.client.AnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
81-81:
.client.SyncAnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
85-85:
.client.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
85-85:
.client.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
86-86:
.client.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
86-86:
.client.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.client.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.client.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.client.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
88-88:
.client.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
89-89:
.client.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
92-92:
.client.ManageClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
92-92:
.client.AsyncManageClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
94-94:
.client.ProjectOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
95-95:
.client.KeyOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
96-96:
.client.ScopeOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
97-97:
.client.InviteOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
98-98:
.client.UsageRequestOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
99-99:
.client.UsageSummaryOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
100-100:
.client.UsageFieldsOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
105-105:
.client.Message
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
106-106:
.client.Project
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
107-107:
.client.ProjectsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
108-108:
.client.MembersResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
109-109:
.client.Key
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
110-110:
.client.KeyResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
111-111:
.client.KeysResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
112-112:
.client.ScopesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
113-113:
.client.InvitesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
114-114:
.client.UsageRequest
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
115-115:
.client.UsageRequestsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
116-116:
.client.UsageSummaryResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
117-117:
.client.UsageFieldsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
118-118:
.client.Balance
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
119-119:
.client.BalancesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
124-124:
.client.OnPremClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
125-125:
.client.AsyncOnPremClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
126-126:
.client.SelfHostedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
127-127:
.client.AsyncSelfHostedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
131-131:
.audio.Microphone
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
133-133:
.audio.LOGGING
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
134-134:
.audio.CHANNELS
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
135-135:
.audio.RATE
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
136-136:
.audio.CHUNK
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)examples/speak-stream/async-interactive/main.py
3-3:
json
imported but unused (F401)Remove unused import:
json
examples/speak-stream/interactive/main.py
8-8:
json
imported but unused (F401)Remove unused import:
json
deepgram/client.py
15-15:
.clients.TextSource
imported but unused (F401)Remove unused import
16-16:
.clients.BufferSource
imported but unused (F401)Remove unused import
17-17:
.clients.StreamSource
imported but unused (F401)Remove unused import
18-18:
.clients.FileSource
imported but unused (F401)Remove unused import
19-19:
.clients.UrlSource
imported but unused (F401)Remove unused import
20-20:
.clients.Sentiment
imported but unused (F401)Remove unused import
27-27:
.clients.LiveClient
imported but unused (F401)Remove unused import
27-27:
.clients.AsyncLiveClient
imported but unused (F401)Remove unused import
29-29:
.clients.LiveOptions
imported but unused (F401)Remove unused import
30-30:
.clients.LiveTranscriptionEvents
imported but unused (F401)Remove unused import
35-35:
.clients.OpenResponse
imported but unused (F401)Remove unused import
36-36:
.clients.LiveResultResponse
imported but unused (F401)Remove unused import
37-37:
.clients.MetadataResponse
imported but unused (F401)Remove unused import
38-38:
.clients.SpeechStartedResponse
imported but unused (F401)Remove unused import
39-39:
.clients.UtteranceEndResponse
imported but unused (F401)Remove unused import
40-40:
.clients.CloseResponse
imported but unused (F401)Remove unused import
41-41:
.clients.ErrorResponse
imported but unused (F401)Remove unused import
42-42:
.clients.UnhandledResponse
imported but unused (F401)Remove unused import
47-47:
.clients.PreRecordedClient
imported but unused (F401)Remove unused import
48-48:
.clients.AsyncPreRecordedClient
imported but unused (F401)Remove unused import
51-51:
.clients.PrerecordedOptions
imported but unused (F401)Remove unused import
52-52:
.clients.PreRecordedStreamSource
imported but unused (F401)Remove unused import
53-53:
.clients.PrerecordedSource
imported but unused (F401)Remove unused import
58-58:
.clients.AsyncPrerecordedResponse
imported but unused (F401)Remove unused import
59-59:
.clients.PrerecordedResponse
imported but unused (F401)Remove unused import
60-60:
.clients.SyncPrerecordedResponse
imported but unused (F401)Remove unused import
64-64:
.clients.ReadClient
imported but unused (F401)Remove unused import
64-64:
.clients.AsyncReadClient
imported but unused (F401)Remove unused import
65-65:
.clients.AnalyzeClient
imported but unused (F401)Remove unused import
65-65:
.clients.AsyncAnalyzeClient
imported but unused (F401)Remove unused import
67-67:
.clients.AnalyzeOptions
imported but unused (F401)Remove unused import
68-68:
.clients.AnalyzeStreamSource
imported but unused (F401)Remove unused import
69-69:
.clients.AnalyzeSource
imported but unused (F401)Remove unused import
74-74:
.clients.AsyncAnalyzeResponse
imported but unused (F401)Remove unused import
75-75:
.clients.AnalyzeResponse
imported but unused (F401)Remove unused import
76-76:
.clients.SyncAnalyzeResponse
imported but unused (F401)Remove unused import
80-80:
.clients.SpeakClient
imported but unused (F401)Remove unused import
80-80:
.clients.AsyncSpeakClient
imported but unused (F401)Remove unused import
81-81:
.clients.SpeakStreamClient
imported but unused (F401)Remove unused import
81-81:
.clients.AsyncSpeakStreamClient
imported but unused (F401)Remove unused import
82-82:
.clients.SpeakOptions
imported but unused (F401)Remove unused import:
.clients.SpeakOptions
83-83:
.clients.SpeakStreamSource
imported but unused (F401)Remove unused import
83-83:
.clients.SpeakSource
imported but unused (F401)Remove unused import
84-84:
.clients.SpeakStreamEvents
imported but unused (F401)Remove unused import:
.clients.SpeakStreamEvents
87-87:
.clients.SpeakResponse
imported but unused (F401)Remove unused import:
.clients.SpeakResponse
90-90:
.clients.ManageClient
imported but unused (F401)Remove unused import
90-90:
.clients.AsyncManageClient
imported but unused (F401)Remove unused import
92-92:
.clients.ProjectOptions
imported but unused (F401)Remove unused import
93-93:
.clients.KeyOptions
imported but unused (F401)Remove unused import
94-94:
.clients.ScopeOptions
imported but unused (F401)Remove unused import
95-95:
.clients.InviteOptions
imported but unused (F401)Remove unused import
96-96:
.clients.UsageRequestOptions
imported but unused (F401)Remove unused import
97-97:
.clients.UsageSummaryOptions
imported but unused (F401)Remove unused import
98-98:
.clients.UsageFieldsOptions
imported but unused (F401)Remove unused import
103-103:
.clients.Message
imported but unused (F401)Remove unused import
104-104:
.clients.Project
imported but unused (F401)Remove unused import
105-105:
.clients.ProjectsResponse
imported but unused (F401)Remove unused import
106-106:
.clients.MembersResponse
imported but unused (F401)Remove unused import
107-107:
.clients.Key
imported but unused (F401)Remove unused import
108-108:
.clients.KeyResponse
imported but unused (F401)Remove unused import
109-109:
.clients.KeysResponse
imported but unused (F401)Remove unused import
110-110:
.clients.ScopesResponse
imported but unused (F401)Remove unused import
111-111:
.clients.InvitesResponse
imported but unused (F401)Remove unused import
112-112:
.clients.UsageRequest
imported but unused (F401)Remove unused import
113-113:
.clients.UsageRequestsResponse
imported but unused (F401)Remove unused import
114-114:
.clients.UsageSummaryResponse
imported but unused (F401)Remove unused import
115-115:
.clients.UsageFieldsResponse
imported but unused (F401)Remove unused import
116-116:
.clients.Balance
imported but unused (F401)Remove unused import
117-117:
.clients.BalancesResponse
imported but unused (F401)Remove unused import
122-122:
.clients.OnPremClient
imported but unused (F401)Remove unused import
123-123:
.clients.AsyncOnPremClient
imported but unused (F401)Remove unused import
124-124:
.clients.SelfHostedClient
imported but unused (F401)Remove unused import
125-125:
.clients.AsyncSelfHostedClient
imported but unused (F401)Remove unused import
129-129:
.options.ClientOptionsFromEnv
imported but unused (F401)Remove unused import:
.options.ClientOptionsFromEnv
130-130:
.errors.DeepgramApiKeyError
imported but unused (F401)Remove unused import:
.errors.DeepgramApiKeyError
Additional comments not posted (8)
deepgram/clients/speak/client.py (1)
Line range hint
7-35
: Updated class references to latest versions are correctly implemented.The imports and aliases are correctly updated to reference the latest versions of the classes, which aligns with the SDK's versioning strategy to support backward compatibility.
deepgram/client.py (1)
81-84
: Introduction of SpeakStreamClient and AsyncSpeakStreamClientThe introduction of
SpeakStreamClient
andAsyncSpeakStreamClient
properties in theDeepgramClient
class is a significant enhancement, aligning with the new feature set of TTS streaming. Here are a few points to consider:
- Documentation: The documentation for these new properties is clear and concise, explaining their purpose and usage well.
- Error Handling: Consider adding error handling within the
Version
class methods to manage cases where the module or class cannot be found, as this could lead to runtime errors.- Testing: Ensure that these new properties are covered by unit tests, particularly testing edge cases and error scenarios.
These additions are crucial for supporting the new TTS streaming functionality and are implemented correctly in the context of the existing SDK architecture.
Also applies to: 241-253
Tools
Ruff
81-81:
.clients.SpeakStreamClient
imported but unused (F401)Remove unused import
81-81:
.clients.AsyncSpeakStreamClient
imported but unused (F401)Remove unused import
82-82:
.clients.SpeakOptions
imported but unused (F401)Remove unused import:
.clients.SpeakOptions
83-83:
.clients.SpeakStreamSource
imported but unused (F401)Remove unused import
83-83:
.clients.SpeakSource
imported but unused (F401)Remove unused import
84-84:
.clients.SpeakStreamEvents
imported but unused (F401)Remove unused import:
.clients.SpeakStreamEvents
deepgram/clients/speak/v1/client_stream.py (5)
190-198
: Validate event handler registration in theon
method.The
on
method correctly checks if the event is valid and if the handler is callable before appending it to the event handlers list. This prevents potential runtime errors and ensures that only valid handlers are registered.
216-386
: Optimize the_listening
method's exception handling and control flow.The
_listening
method is designed to continuously listen for messages from the WebSocket connection. However, the method's exception handling and control flow can be optimized to reduce redundancy and improve clarity.
[REFACTOR_Suggestion]- except websockets.exceptions.ConnectionClosed as e: - if e.code == 1000: - self._logger.notice(f"_listening({e.code}) exiting gracefully") - self._logger.debug("SpeakStreamClient._listening LEAVE") - return - self._logger.error( - "ConnectionClosed in SpeakStreamClient._listening with code %s: %s", - e.code, - e.reason, - ) - cc_error: ErrorResponse = ErrorResponse( - "ConnectionClosed in SpeakStreamClient._listening", - f"{e}", - "ConnectionClosed", - ) - self._emit( - SpeakStreamEvents(SpeakStreamEvents.Error), cc_error - ) - # signal exit and close - self._signal_exit() - self._logger.debug("SpeakStreamClient._listening LEAVE") - if self._config.options.get("termination_exception") == "true": - raise - return + except websockets.exceptions.ConnectionClosed as e: + self._handle_connection_closed(e)Create a new method
_handle_connection_closed
to handleConnectionClosed
exceptions, which will centralize the error handling and make the code cleaner.
390-445
: Review thesend
method's error handling and socket check.The
send
method includes comprehensive error handling for various WebSocket exceptions. However, the method first checks if the socket is notNone
before proceeding, which is a good practice to avoidNoneType
errors.
450-477
: Ensure robustness in theflush
method.The
flush
method attempts to send a "Flush" command via the WebSocket connection. It correctly checks the return value to determine if the flush was successful. This method is crucial for ensuring that all pending data is sent before closing the connection.
480-508
: Validate thefinish
method's thread management and cleanup.The
finish
method handles the graceful closure of the WebSocket connection and ensures that all associated threads are properly joined. This is crucial for avoiding resource leaks and ensuring that the application exits cleanly.deepgram/clients/speak/v1/async_client_stream.py (1)
77-183
: Review thestart
method for error handling and logic flow.
- The method logs extensively, which is good for debugging, but ensure that logging does not expose sensitive information.
- The method handles different types of exceptions and re-raises them based on a configuration option. This is a flexible error handling strategy but verify that it is consistent with the overall error handling strategy of the SDK.
- The use of
isinstance
checks forSpeakOptions
could be streamlined by ensuringoptions
is always a valid instance orNone
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that plus the existing coderabbit stuff (already dismissed a bunch of stuff we don't want to tackle right now), this looks great!
It's just the coderabbit stuff now. I think we are good to go after those updates.
1ff0e05
to
a53a297
Compare
a53a297
to
3b6c941
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
Outside diff range and nitpick comments (2)
deepgram/client.py (1)
Line range hint
15-15
: Suggestion to remove unused imports.The static analysis has identified multiple imports that are currently unused. Removing these can help clean up the codebase and potentially improve the module's load time and memory usage.
- from .clients import TextSource, BufferSource, StreamSource, FileSource, UrlSource, Sentiment, LiveClient, AsyncLiveClient, LiveOptions, LiveTranscriptionEvents, OpenResponse, LiveResultResponse, MetadataResponse, SpeechStartedResponse, UtteranceEndResponse, CloseResponse, ErrorResponse, UnhandledResponse, PreRecordedClient, AsyncPreRecordedClient, PrerecordedOptions, PreRecordedStreamSource, PrerecordedSource, AsyncPrerecordedResponse, PrerecordedResponse, SyncPrerecordedResponse, ReadClient, AsyncReadClient, AnalyzeClient, AsyncAnalyzeClient, AnalyzeOptions, AnalyzeStreamSource, AnalyzeSource, AsyncAnalyzeResponse, AnalyzeResponse, SyncAnalyzeResponse, SpeakClient, AsyncSpeakClient, SpeakStreamClient, AsyncSpeakStreamClient, SpeakOptions, SpeakStreamSource, SpeakSource, SpeakStreamEvents, SpeakResponse, ManageClient, AsyncManageClient, ProjectOptions, KeyOptions, ScopeOptions, InviteOptions, UsageRequestOptions, UsageSummaryOptions, UsageFieldsOptions, Message, Project, ProjectsResponse, MembersResponse, Key, KeyResponse, KeysResponse, ScopesResponse, InvitesResponse, UsageRequest, UsageRequestsResponse, UsageSummaryResponse, UsageFieldsResponse, Balance, BalancesResponse, OnPremClient, AsyncOnPremClient, SelfHostedClient, AsyncSelfHostedClient, ClientOptionsFromEnv, DeepgramApiKeyErrorAlso applies to: 16-16, 17-17, 18-18, 19-19, 20-20, 27-27, 27-27, 29-29, 30-30, 35-35, 36-36, 37-37, 38-38, 39-39, 40-40, 41-41, 42-42, 47-47, 48-48, 51-51, 52-52, 53-53, 58-58, 59-59, 60-60, 64-64, 64-64, 65-65, 65-65, 67-67, 68-68, 69-69, 74-74, 75-75, 76-76, 80-80, 80-80, 81-81, 81-81, 82-82, 83-83, 83-83, 84-84, 87-87, 87-87, 92-92, 93-93, 94-94, 95-95, 96-96, 97-97, 98-98, 103-103, 104-104, 105-105, 106-106, 107-107, 108-108, 109-109, 110-110, 111-111, 112-112, 113-113, 114-114, 115-115, 116-116, 117-117, 122-122, 123-123, 124-124, 125-125, 129-129, 130-130
Tools
Ruff
80-80:
.clients.SpeakClient
imported but unused (F401)Remove unused import
80-80:
.clients.AsyncSpeakClient
imported but unused (F401)Remove unused import
81-81:
.clients.SpeakStreamClient
imported but unused (F401)Remove unused import
81-81:
.clients.AsyncSpeakStreamClient
imported but unused (F401)Remove unused import
82-82:
.clients.SpeakOptions
imported but unused (F401)Remove unused import:
.clients.SpeakOptions
83-83:
.clients.SpeakStreamSource
imported but unused (F401)Remove unused import
83-83:
.clients.SpeakSource
imported but unused (F401)Remove unused import
84-84:
.clients.SpeakStreamEvents
imported but unused (F401)Remove unused import:
.clients.SpeakStreamEvents
87-87:
.clients.SpeakResponse
imported but unused (F401)Remove unused import:
.clients.SpeakResponse
deepgram/clients/speak/v1/async_client_stream.py (1)
228-417
: Enhance error handling in the_listening
method.Ensure robust error handling for different WebSocket exceptions. Consider adding specific error handling for different WebSocket error codes to improve the method's resilience.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (14)
- deepgram/init.py (1 hunks)
- deepgram/client.py (5 hunks)
- deepgram/clients/init.py (1 hunks)
- deepgram/clients/live/v1/async_client.py (3 hunks)
- deepgram/clients/speak/init.py (2 hunks)
- deepgram/clients/speak/client.py (2 hunks)
- deepgram/clients/speak/enums.py (1 hunks)
- deepgram/clients/speak/errors.py (1 hunks)
- deepgram/clients/speak/v1/init.py (1 hunks)
- deepgram/clients/speak/v1/async_client_stream.py (1 hunks)
- deepgram/clients/speak/v1/client_stream.py (1 hunks)
- deepgram/clients/speak/v1/response.py (1 hunks)
- examples/speak-stream/async-interactive/main.py (1 hunks)
- examples/speak-stream/interactive/main.py (1 hunks)
Files skipped from review as they are similar to previous changes (5)
- deepgram/clients/speak/client.py
- deepgram/clients/speak/enums.py
- deepgram/clients/speak/errors.py
- deepgram/clients/speak/v1/response.py
- examples/speak-stream/async-interactive/main.py
Additional context used
Learnings (2)
deepgram/clients/speak/v1/client_stream.py (2)
User: dvonthenen PR: deepgram/deepgram-python-sdk#424 File: deepgram/clients/speak/v1/client_stream.py:59-79 Timestamp: 2024-06-25T15:26:40.699Z Learning: The `config` object is always created before being passed to the `SpeakStreamClient` constructor, and should not be `null`.
User: dvonthenen PR: deepgram/deepgram-python-sdk#424 File: deepgram/clients/speak/v1/async_client_stream.py:55-74 Timestamp: 2024-06-25T15:18:16.852Z Learning: The `config` parameter in the `AsyncSpeakStreamClient` constructor should not be optional and must be enforced at the type level.
deepgram/clients/speak/v1/async_client_stream.py (2)
User: dvonthenen PR: deepgram/deepgram-python-sdk#424 File: deepgram/clients/speak/v1/async_client_stream.py:55-74 Timestamp: 2024-06-25T15:18:16.852Z Learning: The `config` parameter in the `AsyncSpeakStreamClient` constructor should not be optional and must be enforced at the type level.
User: dvonthenen PR: deepgram/deepgram-python-sdk#424 File: deepgram/clients/speak/v1/client_stream.py:59-79 Timestamp: 2024-06-25T15:26:40.699Z Learning: The `config` object is always created before being passed to the `SpeakStreamClient` constructor, and should not be `null`.
Ruff
deepgram/clients/speak/v1/__init__.py
5-5:
.client.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client_stream.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
7-7:
.async_client_stream.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
8-8:
.async_client.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.options.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.options.FileSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.options.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.options.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
10-10:
.response.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
....options.DeepgramClientOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
....options.ClientOptionsFromEnv
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/clients/speak/__init__.py
5-5:
.client.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
7-7:
.client.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
8-8:
.client.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.client.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
11-11:
.client.FileSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
.client.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
13-13:
.client.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
16-16:
.enums.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
17-17:
...options.DeepgramClientOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
17-17:
...options.ClientOptionsFromEnv
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/clients/__init__.py
7-7:
.common.TextSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
8-8:
.common.BufferSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.common.StreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
10-10:
.common.FileSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
11-11:
.common.UrlSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
.common.Sentiment
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
16-16:
.listen.Listen
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
17-17:
.read.Read
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
20-20:
.live.LiveClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
20-20:
.live.AsyncLiveClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
21-21:
.live.LiveOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
22-22:
.live.LiveTranscriptionEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
24-24:
.live.OpenResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
25-25:
.live.LiveResultResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
26-26:
.live.MetadataResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
27-27:
.live.SpeechStartedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
28-28:
.live.UtteranceEndResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
29-29:
.live.CloseResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
30-30:
.live.ErrorResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
31-31:
.live.UnhandledResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
35-35:
.prerecorded.PreRecordedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
35-35:
.prerecorded.AsyncPreRecordedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
36-36:
.prerecorded.PrerecordedOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
38-38:
.prerecorded.PreRecordedStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
39-39:
.prerecorded.PrerecordedSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
42-42:
.prerecorded.AsyncPrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
43-43:
.prerecorded.PrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
44-44:
.prerecorded.SyncPrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
48-48:
.analyze.ReadClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
48-48:
.analyze.AsyncReadClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
49-49:
.analyze.AnalyzeClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
49-49:
.analyze.AsyncAnalyzeClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
50-50:
.analyze.AnalyzeOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
52-52:
.analyze.AnalyzeStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
53-53:
.analyze.AnalyzeSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
56-56:
.analyze.AsyncAnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
57-57:
.analyze.AnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
58-58:
.analyze.SyncAnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
62-62:
.speak.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
62-62:
.speak.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
63-63:
.speak.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
65-65:
.speak.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
66-66:
.speak.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
68-68:
.speak.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
69-69:
.speak.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.speak.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.speak.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
75-75:
.manage.ManageClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
75-75:
.manage.AsyncManageClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
77-77:
.manage.ProjectOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
78-78:
.manage.KeyOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
79-79:
.manage.ScopeOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
80-80:
.manage.InviteOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
81-81:
.manage.UsageRequestOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
82-82:
.manage.UsageSummaryOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
83-83:
.manage.UsageFieldsOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
86-86:
.manage.Message
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.manage.Project
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
88-88:
.manage.ProjectsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
89-89:
.manage.MembersResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
90-90:
.manage.Key
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
91-91:
.manage.KeyResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
92-92:
.manage.KeysResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
93-93:
.manage.ScopesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
94-94:
.manage.InvitesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
95-95:
.manage.UsageRequest
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
96-96:
.manage.UsageRequestsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
97-97:
.manage.UsageSummaryResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
98-98:
.manage.UsageFieldsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
99-99:
.manage.Balance
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
100-100:
.manage.BalancesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
105-105:
.selfhosted.OnPremClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
106-106:
.selfhosted.AsyncOnPremClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
107-107:
.selfhosted.SelfHostedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
108-108:
.selfhosted.AsyncSelfHostedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/__init__.py
9-9:
logging
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
10-10:
.utils.VerboseLogger
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
.utils.NOTICE
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
13-13:
.utils.SPAM
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
14-14:
.utils.SUCCESS
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
15-15:
.utils.VERBOSE
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
16-16:
.utils.WARNING
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
17-17:
.utils.ERROR
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
18-18:
.utils.FATAL
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
19-19:
.utils.CRITICAL
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
20-20:
.utils.INFO
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
21-21:
.utils.DEBUG
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
22-22:
.utils.NOTSET
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
25-25:
.client.Deepgram
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
25-25:
.client.DeepgramClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
26-26:
.client.DeepgramClientOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
26-26:
.client.ClientOptionsFromEnv
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
27-27:
.client.DeepgramApiKeyError
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
27-27:
.client.DeepgramModuleError
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
30-30:
.client.Listen
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
30-30:
.client.Read
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
34-34:
.client.TextSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
35-35:
.client.BufferSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
36-36:
.client.StreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
37-37:
.client.FileSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
38-38:
.client.UrlSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
39-39:
.client.Sentiment
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
43-43:
.client.LiveTranscriptionEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
44-44:
.client.LiveClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
44-44:
.client.AsyncLiveClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
45-45:
.client.LiveOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
47-47:
.client.OpenResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
48-48:
.client.LiveResultResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
49-49:
.client.MetadataResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
50-50:
.client.SpeechStartedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
51-51:
.client.UtteranceEndResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
52-52:
.client.CloseResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
53-53:
.client.UnhandledResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
54-54:
.client.ErrorResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
58-58:
.client.PreRecordedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
58-58:
.client.AsyncPreRecordedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
60-60:
.client.PrerecordedOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
61-61:
.client.PreRecordedStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
62-62:
.client.PrerecordedSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
65-65:
.client.AsyncPrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
66-66:
.client.PrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
67-67:
.client.SyncPrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
71-71:
.client.ReadClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
71-71:
.client.AsyncReadClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.client.AnalyzeClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.client.AsyncAnalyzeClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
74-74:
.client.AnalyzeOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
75-75:
.client.AnalyzeStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
76-76:
.client.AnalyzeSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
79-79:
.client.AsyncAnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
80-80:
.client.AnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
81-81:
.client.SyncAnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
85-85:
.client.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
85-85:
.client.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
86-86:
.client.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
86-86:
.client.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.client.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.client.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.client.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
88-88:
.client.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
89-89:
.client.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
92-92:
.client.ManageClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
92-92:
.client.AsyncManageClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
94-94:
.client.ProjectOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
95-95:
.client.KeyOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
96-96:
.client.ScopeOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
97-97:
.client.InviteOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
98-98:
.client.UsageRequestOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
99-99:
.client.UsageSummaryOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
100-100:
.client.UsageFieldsOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
105-105:
.client.Message
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
106-106:
.client.Project
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
107-107:
.client.ProjectsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
108-108:
.client.MembersResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
109-109:
.client.Key
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
110-110:
.client.KeyResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
111-111:
.client.KeysResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
112-112:
.client.ScopesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
113-113:
.client.InvitesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
114-114:
.client.UsageRequest
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
115-115:
.client.UsageRequestsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
116-116:
.client.UsageSummaryResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
117-117:
.client.UsageFieldsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
118-118:
.client.Balance
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
119-119:
.client.BalancesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
124-124:
.client.OnPremClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
125-125:
.client.AsyncOnPremClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
126-126:
.client.SelfHostedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
127-127:
.client.AsyncSelfHostedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
131-131:
.audio.Microphone
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
133-133:
.audio.LOGGING
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
134-134:
.audio.CHANNELS
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
135-135:
.audio.RATE
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
136-136:
.audio.CHUNK
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/client.py
15-15:
.clients.TextSource
imported but unused (F401)Remove unused import
16-16:
.clients.BufferSource
imported but unused (F401)Remove unused import
17-17:
.clients.StreamSource
imported but unused (F401)Remove unused import
18-18:
.clients.FileSource
imported but unused (F401)Remove unused import
19-19:
.clients.UrlSource
imported but unused (F401)Remove unused import
20-20:
.clients.Sentiment
imported but unused (F401)Remove unused import
27-27:
.clients.LiveClient
imported but unused (F401)Remove unused import
27-27:
.clients.AsyncLiveClient
imported but unused (F401)Remove unused import
29-29:
.clients.LiveOptions
imported but unused (F401)Remove unused import
30-30:
.clients.LiveTranscriptionEvents
imported but unused (F401)Remove unused import
35-35:
.clients.OpenResponse
imported but unused (F401)Remove unused import
36-36:
.clients.LiveResultResponse
imported but unused (F401)Remove unused import
37-37:
.clients.MetadataResponse
imported but unused (F401)Remove unused import
38-38:
.clients.SpeechStartedResponse
imported but unused (F401)Remove unused import
39-39:
.clients.UtteranceEndResponse
imported but unused (F401)Remove unused import
40-40:
.clients.CloseResponse
imported but unused (F401)Remove unused import
41-41:
.clients.ErrorResponse
imported but unused (F401)Remove unused import
42-42:
.clients.UnhandledResponse
imported but unused (F401)Remove unused import
47-47:
.clients.PreRecordedClient
imported but unused (F401)Remove unused import
48-48:
.clients.AsyncPreRecordedClient
imported but unused (F401)Remove unused import
51-51:
.clients.PrerecordedOptions
imported but unused (F401)Remove unused import
52-52:
.clients.PreRecordedStreamSource
imported but unused (F401)Remove unused import
53-53:
.clients.PrerecordedSource
imported but unused (F401)Remove unused import
58-58:
.clients.AsyncPrerecordedResponse
imported but unused (F401)Remove unused import
59-59:
.clients.PrerecordedResponse
imported but unused (F401)Remove unused import
60-60:
.clients.SyncPrerecordedResponse
imported but unused (F401)Remove unused import
64-64:
.clients.ReadClient
imported but unused (F401)Remove unused import
64-64:
.clients.AsyncReadClient
imported but unused (F401)Remove unused import
65-65:
.clients.AnalyzeClient
imported but unused (F401)Remove unused import
65-65:
.clients.AsyncAnalyzeClient
imported but unused (F401)Remove unused import
67-67:
.clients.AnalyzeOptions
imported but unused (F401)Remove unused import
68-68:
.clients.AnalyzeStreamSource
imported but unused (F401)Remove unused import
69-69:
.clients.AnalyzeSource
imported but unused (F401)Remove unused import
74-74:
.clients.AsyncAnalyzeResponse
imported but unused (F401)Remove unused import
75-75:
.clients.AnalyzeResponse
imported but unused (F401)Remove unused import
76-76:
.clients.SyncAnalyzeResponse
imported but unused (F401)Remove unused import
80-80:
.clients.SpeakClient
imported but unused (F401)Remove unused import
80-80:
.clients.AsyncSpeakClient
imported but unused (F401)Remove unused import
81-81:
.clients.SpeakStreamClient
imported but unused (F401)Remove unused import
81-81:
.clients.AsyncSpeakStreamClient
imported but unused (F401)Remove unused import
82-82:
.clients.SpeakOptions
imported but unused (F401)Remove unused import:
.clients.SpeakOptions
83-83:
.clients.SpeakStreamSource
imported but unused (F401)Remove unused import
83-83:
.clients.SpeakSource
imported but unused (F401)Remove unused import
84-84:
.clients.SpeakStreamEvents
imported but unused (F401)Remove unused import:
.clients.SpeakStreamEvents
87-87:
.clients.SpeakResponse
imported but unused (F401)Remove unused import:
.clients.SpeakResponse
90-90:
.clients.ManageClient
imported but unused (F401)Remove unused import
90-90:
.clients.AsyncManageClient
imported but unused (F401)Remove unused import
92-92:
.clients.ProjectOptions
imported but unused (F401)Remove unused import
93-93:
.clients.KeyOptions
imported but unused (F401)Remove unused import
94-94:
.clients.ScopeOptions
imported but unused (F401)Remove unused import
95-95:
.clients.InviteOptions
imported but unused (F401)Remove unused import
96-96:
.clients.UsageRequestOptions
imported but unused (F401)Remove unused import
97-97:
.clients.UsageSummaryOptions
imported but unused (F401)Remove unused import
98-98:
.clients.UsageFieldsOptions
imported but unused (F401)Remove unused import
103-103:
.clients.Message
imported but unused (F401)Remove unused import
104-104:
.clients.Project
imported but unused (F401)Remove unused import
105-105:
.clients.ProjectsResponse
imported but unused (F401)Remove unused import
106-106:
.clients.MembersResponse
imported but unused (F401)Remove unused import
107-107:
.clients.Key
imported but unused (F401)Remove unused import
108-108:
.clients.KeyResponse
imported but unused (F401)Remove unused import
109-109:
.clients.KeysResponse
imported but unused (F401)Remove unused import
110-110:
.clients.ScopesResponse
imported but unused (F401)Remove unused import
111-111:
.clients.InvitesResponse
imported but unused (F401)Remove unused import
112-112:
.clients.UsageRequest
imported but unused (F401)Remove unused import
113-113:
.clients.UsageRequestsResponse
imported but unused (F401)Remove unused import
114-114:
.clients.UsageSummaryResponse
imported but unused (F401)Remove unused import
115-115:
.clients.UsageFieldsResponse
imported but unused (F401)Remove unused import
116-116:
.clients.Balance
imported but unused (F401)Remove unused import
117-117:
.clients.BalancesResponse
imported but unused (F401)Remove unused import
122-122:
.clients.OnPremClient
imported but unused (F401)Remove unused import
123-123:
.clients.AsyncOnPremClient
imported but unused (F401)Remove unused import
124-124:
.clients.SelfHostedClient
imported but unused (F401)Remove unused import
125-125:
.clients.AsyncSelfHostedClient
imported but unused (F401)Remove unused import
129-129:
.options.ClientOptionsFromEnv
imported but unused (F401)Remove unused import:
.options.ClientOptionsFromEnv
130-130:
.errors.DeepgramApiKeyError
imported but unused (F401)Remove unused import:
.errors.DeepgramApiKeyError
deepgram/clients/speak/v1/async_client_stream.py
193-194: Use a single
if
statement instead of nestedif
statements (SIM102)deepgram/clients/live/v1/async_client.py
223-224: Use a single
if
statement instead of nestedif
statements (SIM102)
Additional comments not posted (14)
deepgram/clients/speak/v1/__init__.py (1)
6-7
: Consider adding new imports to__all__
to clarify their purpose.The imports of
SpeakStreamClient
andAsyncSpeakStreamClient
are flagged as unused. If these are intended for export, they should be included in the__all__
list. This will clarify their purpose and avoid linting issues.Tools
Ruff
6-6:
.client_stream.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
7-7:
.async_client_stream.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/clients/speak/__init__.py (1)
Line range hint
6-16
: Consider adding new imports to__all__
to clarify their purpose.The imports of
SpeakStreamClient
,AsyncSpeakStreamClient
, andSpeakStreamEvents
are flagged as unused. If these are intended for export, they should be included in the__all__
list. This will clarify their purpose and avoid linting issues.Tools
Ruff
5-5:
.client.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
7-7:
.client.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
8-8:
.client.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.client.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/clients/__init__.py (1)
68-73
: Consider adding new imports to__all__
to clarify their purpose.The imports of
SpeakStreamClient
,AsyncSpeakStreamClient
, andSpeakStreamEvents
are flagged as unused. If these are intended for export, they should be included in the__all__
list. This will clarify their purpose and avoid linting issues.Tools
Ruff
68-68:
.speak.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
69-69:
.speak.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.speak.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.speak.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/__init__.py (1)
86-89
: Consider adding new imports to__all__
to clarify their purpose.The imports of
SpeakStreamClient
,AsyncSpeakStreamClient
, andSpeakStreamEvents
are flagged as unused. If these are intended for export, they should be included in the__all__
list. This will clarify their purpose and avoid linting issues.Tools
Ruff
86-86:
.client.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
86-86:
.client.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.client.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.client.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.client.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
88-88:
.client.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
89-89:
.client.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)examples/speak-stream/interactive/main.py (1)
24-93
: Refactor to use structured logging and improve error handling.Replace print statements with structured logging for better consistency and maintainability. Improve error handling by catching specific exceptions and using more descriptive error messages.
import logging + logger = logging.getLogger(__name__) - print(f"\n\n{open}\n\n") + logger.info(f"Open: {open}") - print("Failed to start connection") + logger.error("Failed to start connection")deepgram/client.py (2)
241-245
: Approval forspeakstream
property addition.
The implementation for accessingSpeakStreamClient
throughspeakstream
property is consistent with the existing architecture of the client.
247-252
: Approval forasyncspeakstream
property addition.
The addition of theasyncspeakstream
property to accessAsyncSpeakStreamClient
aligns well with the SDK's architecture and provides a clear asynchronous alternative.deepgram/clients/speak/v1/client_stream.py (3)
60-81
: Constructor review forSpeakStreamClient
.The constructor properly initializes all necessary instance attributes and sets up logging. The check for
config
beingNone
is consistent with the previous discussions and learnings indicating that theconfig
object is always created before being passed to the constructor.
398-450
: Review ofsend
method inSpeakStreamClient
.The method correctly handles thread safety with a lock and provides comprehensive error handling. The logging level might be adjusted to provide more appropriate feedback in production environments.
- self._logger.spam("SpeakStreamClient.send ENTER") + self._logger.debug("SpeakStreamClient.send ENTER")
459-486
: Review offlush
method inSpeakStreamClient
.The method effectively uses the
send
method to flush the WebSocket buffer and handles potential errors well.deepgram/clients/speak/v1/async_client_stream.py (2)
197-226
: Good management of tasks in the_emit
method.The method correctly creates tasks for each event handler, waits for them to complete, and clears the list to prevent memory leaks.
554-596
: Ensure proper cleanup in the_signal_exit
method.The method should ensure that all tasks are completed and the WebSocket is closed properly to avoid resource leaks.
deepgram/clients/live/v1/async_client.py (2)
242-248
: Efficient handling of asynchronous tasks.Creating and awaiting tasks for each event handler ensures that all handlers are executed in parallel, and using
asyncio.gather
withreturn_exceptions=True
is a good practice to handle exceptions gracefully.
386-386
: Proper handling of specific WebSocket error codes.Handling specific WebSocket error codes (
1000
,1001
) gracefully is a good practice. Consider adding a comment or documentation to explain why these specific codes are treated differently, enhancing maintainability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 18
Outside diff range and nitpick comments (2)
deepgram/clients/speak/__init__.py (1)
Line range hint
6-16
: Consolidate imports from the same module for clarity.Multiple imports from
.client
can be consolidated to improve clarity and maintainability.- from .client import SpeakClient - from .client import SpeakStreamClient, AsyncSpeakStreamClient - from .client import AsyncSpeakClient - from .client import SpeakOptions - from .client import SpeakResponse - from .client import ( - FileSource, - SpeakStreamSource, - SpeakSource, - ) + from .client import ( + SpeakClient, + SpeakStreamClient, + AsyncSpeakClient, + SpeakOptions, + SpeakResponse, + FileSource, + SpeakStreamSource, + SpeakSource + )Tools
Ruff
5-5:
.client.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
7-7:
.client.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
8-8:
.client.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.client.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)examples/speak-stream/interactive/main.py (1)
74-79
: Good use of locking to prevent race conditions.The use of
threading.Lock
in thesend_tts_text
function is appropriate to ensure that multiple threads do not cause race conditions when sending text to speech data. However, consider if the threading model can be simplified or improved to avoid excessive thread management complexity.Review the overall threading model to ensure it aligns with best practices and consider alternatives like asynchronous programming if applicable.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (14)
- deepgram/init.py (1 hunks)
- deepgram/client.py (5 hunks)
- deepgram/clients/init.py (1 hunks)
- deepgram/clients/live/v1/async_client.py (3 hunks)
- deepgram/clients/speak/init.py (2 hunks)
- deepgram/clients/speak/client.py (2 hunks)
- deepgram/clients/speak/enums.py (1 hunks)
- deepgram/clients/speak/errors.py (1 hunks)
- deepgram/clients/speak/v1/init.py (1 hunks)
- deepgram/clients/speak/v1/async_client_stream.py (1 hunks)
- deepgram/clients/speak/v1/client_stream.py (1 hunks)
- deepgram/clients/speak/v1/response.py (1 hunks)
- examples/speak-stream/async-interactive/main.py (1 hunks)
- examples/speak-stream/interactive/main.py (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- deepgram/clients/speak/client.py
- deepgram/clients/speak/enums.py
- deepgram/clients/speak/errors.py
Additional context used
Learnings (2)
deepgram/clients/speak/v1/client_stream.py (2)
User: dvonthenen PR: deepgram/deepgram-python-sdk#424 File: deepgram/clients/speak/v1/client_stream.py:59-79 Timestamp: 2024-06-25T15:26:40.699Z Learning: The `config` object is always created before being passed to the `SpeakStreamClient` constructor, and should not be `null`.
User: dvonthenen PR: deepgram/deepgram-python-sdk#424 File: deepgram/clients/speak/v1/async_client_stream.py:55-74 Timestamp: 2024-06-25T15:18:16.852Z Learning: The `config` parameter in the `AsyncSpeakStreamClient` constructor should not be optional and must be enforced at the type level.
deepgram/clients/speak/v1/async_client_stream.py (2)
User: dvonthenen PR: deepgram/deepgram-python-sdk#424 File: deepgram/clients/speak/v1/async_client_stream.py:55-74 Timestamp: 2024-06-25T15:18:16.852Z Learning: The `config` parameter in the `AsyncSpeakStreamClient` constructor should not be optional and must be enforced at the type level.
User: dvonthenen PR: deepgram/deepgram-python-sdk#424 File: deepgram/clients/speak/v1/client_stream.py:59-79 Timestamp: 2024-06-25T15:26:40.699Z Learning: The `config` object is always created before being passed to the `SpeakStreamClient` constructor, and should not be `null`.
Ruff
deepgram/clients/speak/v1/__init__.py
5-5:
.client.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client_stream.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
7-7:
.async_client_stream.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
8-8:
.async_client.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.options.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.options.FileSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.options.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.options.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
10-10:
.response.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
....options.DeepgramClientOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
....options.ClientOptionsFromEnv
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/clients/speak/__init__.py
5-5:
.client.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
6-6:
.client.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
7-7:
.client.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
8-8:
.client.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.client.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
11-11:
.client.FileSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
.client.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
13-13:
.client.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
16-16:
.enums.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
17-17:
...options.DeepgramClientOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
17-17:
...options.ClientOptionsFromEnv
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/clients/__init__.py
7-7:
.common.TextSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
8-8:
.common.BufferSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
9-9:
.common.StreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
10-10:
.common.FileSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
11-11:
.common.UrlSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
.common.Sentiment
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
16-16:
.listen.Listen
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
17-17:
.read.Read
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
20-20:
.live.LiveClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
20-20:
.live.AsyncLiveClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
21-21:
.live.LiveOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
22-22:
.live.LiveTranscriptionEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
24-24:
.live.OpenResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
25-25:
.live.LiveResultResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
26-26:
.live.MetadataResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
27-27:
.live.SpeechStartedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
28-28:
.live.UtteranceEndResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
29-29:
.live.CloseResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
30-30:
.live.ErrorResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
31-31:
.live.UnhandledResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
35-35:
.prerecorded.PreRecordedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
35-35:
.prerecorded.AsyncPreRecordedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
36-36:
.prerecorded.PrerecordedOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
38-38:
.prerecorded.PreRecordedStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
39-39:
.prerecorded.PrerecordedSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
42-42:
.prerecorded.AsyncPrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
43-43:
.prerecorded.PrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
44-44:
.prerecorded.SyncPrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
48-48:
.analyze.ReadClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
48-48:
.analyze.AsyncReadClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
49-49:
.analyze.AnalyzeClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
49-49:
.analyze.AsyncAnalyzeClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
50-50:
.analyze.AnalyzeOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
52-52:
.analyze.AnalyzeStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
53-53:
.analyze.AnalyzeSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
56-56:
.analyze.AsyncAnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
57-57:
.analyze.AnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
58-58:
.analyze.SyncAnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
62-62:
.speak.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
62-62:
.speak.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
63-63:
.speak.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
65-65:
.speak.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
66-66:
.speak.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
68-68:
.speak.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
69-69:
.speak.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.speak.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.speak.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
75-75:
.manage.ManageClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
75-75:
.manage.AsyncManageClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
77-77:
.manage.ProjectOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
78-78:
.manage.KeyOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
79-79:
.manage.ScopeOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
80-80:
.manage.InviteOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
81-81:
.manage.UsageRequestOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
82-82:
.manage.UsageSummaryOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
83-83:
.manage.UsageFieldsOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
86-86:
.manage.Message
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.manage.Project
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
88-88:
.manage.ProjectsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
89-89:
.manage.MembersResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
90-90:
.manage.Key
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
91-91:
.manage.KeyResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
92-92:
.manage.KeysResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
93-93:
.manage.ScopesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
94-94:
.manage.InvitesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
95-95:
.manage.UsageRequest
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
96-96:
.manage.UsageRequestsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
97-97:
.manage.UsageSummaryResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
98-98:
.manage.UsageFieldsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
99-99:
.manage.Balance
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
100-100:
.manage.BalancesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
105-105:
.selfhosted.OnPremClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
106-106:
.selfhosted.AsyncOnPremClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
107-107:
.selfhosted.SelfHostedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
108-108:
.selfhosted.AsyncSelfHostedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/__init__.py
9-9:
logging
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
10-10:
.utils.VerboseLogger
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
12-12:
.utils.NOTICE
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
13-13:
.utils.SPAM
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
14-14:
.utils.SUCCESS
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
15-15:
.utils.VERBOSE
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
16-16:
.utils.WARNING
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
17-17:
.utils.ERROR
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
18-18:
.utils.FATAL
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
19-19:
.utils.CRITICAL
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
20-20:
.utils.INFO
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
21-21:
.utils.DEBUG
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
22-22:
.utils.NOTSET
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
25-25:
.client.Deepgram
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
25-25:
.client.DeepgramClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
26-26:
.client.DeepgramClientOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
26-26:
.client.ClientOptionsFromEnv
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
27-27:
.client.DeepgramApiKeyError
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
27-27:
.client.DeepgramModuleError
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
30-30:
.client.Listen
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
30-30:
.client.Read
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
34-34:
.client.TextSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
35-35:
.client.BufferSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
36-36:
.client.StreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
37-37:
.client.FileSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
38-38:
.client.UrlSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
39-39:
.client.Sentiment
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
43-43:
.client.LiveTranscriptionEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
44-44:
.client.LiveClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
44-44:
.client.AsyncLiveClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
45-45:
.client.LiveOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
47-47:
.client.OpenResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
48-48:
.client.LiveResultResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
49-49:
.client.MetadataResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
50-50:
.client.SpeechStartedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
51-51:
.client.UtteranceEndResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
52-52:
.client.CloseResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
53-53:
.client.UnhandledResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
54-54:
.client.ErrorResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
58-58:
.client.PreRecordedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
58-58:
.client.AsyncPreRecordedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
60-60:
.client.PrerecordedOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
61-61:
.client.PreRecordedStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
62-62:
.client.PrerecordedSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
65-65:
.client.AsyncPrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
66-66:
.client.PrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
67-67:
.client.SyncPrerecordedResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
71-71:
.client.ReadClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
71-71:
.client.AsyncReadClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.client.AnalyzeClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.client.AsyncAnalyzeClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
74-74:
.client.AnalyzeOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
75-75:
.client.AnalyzeStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
76-76:
.client.AnalyzeSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
79-79:
.client.AsyncAnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
80-80:
.client.AnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
81-81:
.client.SyncAnalyzeResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
85-85:
.client.SpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
85-85:
.client.AsyncSpeakClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
86-86:
.client.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
86-86:
.client.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.client.SpeakOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.client.SpeakStreamSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
87-87:
.client.SpeakSource
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
88-88:
.client.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
89-89:
.client.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
92-92:
.client.ManageClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
92-92:
.client.AsyncManageClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
94-94:
.client.ProjectOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
95-95:
.client.KeyOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
96-96:
.client.ScopeOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
97-97:
.client.InviteOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
98-98:
.client.UsageRequestOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
99-99:
.client.UsageSummaryOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
100-100:
.client.UsageFieldsOptions
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
105-105:
.client.Message
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
106-106:
.client.Project
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
107-107:
.client.ProjectsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
108-108:
.client.MembersResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
109-109:
.client.Key
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
110-110:
.client.KeyResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
111-111:
.client.KeysResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
112-112:
.client.ScopesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
113-113:
.client.InvitesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
114-114:
.client.UsageRequest
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
115-115:
.client.UsageRequestsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
116-116:
.client.UsageSummaryResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
117-117:
.client.UsageFieldsResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
118-118:
.client.Balance
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
119-119:
.client.BalancesResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
124-124:
.client.OnPremClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
125-125:
.client.AsyncOnPremClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
126-126:
.client.SelfHostedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
127-127:
.client.AsyncSelfHostedClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
131-131:
.audio.Microphone
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
133-133:
.audio.LOGGING
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
134-134:
.audio.CHANNELS
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
135-135:
.audio.RATE
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
136-136:
.audio.CHUNK
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)examples/speak-stream/interactive/main.py
8-8:
deepgram.utils.verboselogs
imported but unused (F401)Remove unused import:
deepgram.utils.verboselogs
12-12:
deepgram.DeepgramClientOptions
imported but unused (F401)Remove unused import:
deepgram.DeepgramClientOptions
examples/speak-stream/async-interactive/main.py
4-4:
deepgram.utils.verboselogs
imported but unused (F401)Remove unused import:
deepgram.utils.verboselogs
7-7:
deepgram.DeepgramClientOptions
imported but unused (F401)Remove unused import:
deepgram.DeepgramClientOptions
deepgram/client.py
15-15:
.clients.TextSource
imported but unused (F401)Remove unused import
16-16:
.clients.BufferSource
imported but unused (F401)Remove unused import
17-17:
.clients.StreamSource
imported but unused (F401)Remove unused import
18-18:
.clients.FileSource
imported but unused (F401)Remove unused import
19-19:
.clients.UrlSource
imported but unused (F401)Remove unused import
20-20:
.clients.Sentiment
imported but unused (F401)Remove unused import
27-27:
.clients.LiveClient
imported but unused (F401)Remove unused import
27-27:
.clients.AsyncLiveClient
imported but unused (F401)Remove unused import
29-29:
.clients.LiveOptions
imported but unused (F401)Remove unused import
30-30:
.clients.LiveTranscriptionEvents
imported but unused (F401)Remove unused import
35-35:
.clients.OpenResponse
imported but unused (F401)Remove unused import
36-36:
.clients.LiveResultResponse
imported but unused (F401)Remove unused import
37-37:
.clients.MetadataResponse
imported but unused (F401)Remove unused import
38-38:
.clients.SpeechStartedResponse
imported but unused (F401)Remove unused import
39-39:
.clients.UtteranceEndResponse
imported but unused (F401)Remove unused import
40-40:
.clients.CloseResponse
imported but unused (F401)Remove unused import
41-41:
.clients.ErrorResponse
imported but unused (F401)Remove unused import
42-42:
.clients.UnhandledResponse
imported but unused (F401)Remove unused import
47-47:
.clients.PreRecordedClient
imported but unused (F401)Remove unused import
48-48:
.clients.AsyncPreRecordedClient
imported but unused (F401)Remove unused import
51-51:
.clients.PrerecordedOptions
imported but unused (F401)Remove unused import
52-52:
.clients.PreRecordedStreamSource
imported but unused (F401)Remove unused import
53-53:
.clients.PrerecordedSource
imported but unused (F401)Remove unused import
58-58:
.clients.AsyncPrerecordedResponse
imported but unused (F401)Remove unused import
59-59:
.clients.PrerecordedResponse
imported but unused (F401)Remove unused import
60-60:
.clients.SyncPrerecordedResponse
imported but unused (F401)Remove unused import
64-64:
.clients.ReadClient
imported but unused (F401)Remove unused import
64-64:
.clients.AsyncReadClient
imported but unused (F401)Remove unused import
65-65:
.clients.AnalyzeClient
imported but unused (F401)Remove unused import
65-65:
.clients.AsyncAnalyzeClient
imported but unused (F401)Remove unused import
67-67:
.clients.AnalyzeOptions
imported but unused (F401)Remove unused import
68-68:
.clients.AnalyzeStreamSource
imported but unused (F401)Remove unused import
69-69:
.clients.AnalyzeSource
imported but unused (F401)Remove unused import
74-74:
.clients.AsyncAnalyzeResponse
imported but unused (F401)Remove unused import
75-75:
.clients.AnalyzeResponse
imported but unused (F401)Remove unused import
76-76:
.clients.SyncAnalyzeResponse
imported but unused (F401)Remove unused import
80-80:
.clients.SpeakClient
imported but unused (F401)Remove unused import
80-80:
.clients.AsyncSpeakClient
imported but unused (F401)Remove unused import
81-81:
.clients.SpeakStreamClient
imported but unused (F401)Remove unused import
81-81:
.clients.AsyncSpeakStreamClient
imported but unused (F401)Remove unused import
82-82:
.clients.SpeakOptions
imported but unused (F401)Remove unused import:
.clients.SpeakOptions
83-83:
.clients.SpeakStreamSource
imported but unused (F401)Remove unused import
83-83:
.clients.SpeakSource
imported but unused (F401)Remove unused import
84-84:
.clients.SpeakStreamEvents
imported but unused (F401)Remove unused import:
.clients.SpeakStreamEvents
87-87:
.clients.SpeakResponse
imported but unused (F401)Remove unused import:
.clients.SpeakResponse
90-90:
.clients.ManageClient
imported but unused (F401)Remove unused import
90-90:
.clients.AsyncManageClient
imported but unused (F401)Remove unused import
92-92:
.clients.ProjectOptions
imported but unused (F401)Remove unused import
93-93:
.clients.KeyOptions
imported but unused (F401)Remove unused import
94-94:
.clients.ScopeOptions
imported but unused (F401)Remove unused import
95-95:
.clients.InviteOptions
imported but unused (F401)Remove unused import
96-96:
.clients.UsageRequestOptions
imported but unused (F401)Remove unused import
97-97:
.clients.UsageSummaryOptions
imported but unused (F401)Remove unused import
98-98:
.clients.UsageFieldsOptions
imported but unused (F401)Remove unused import
103-103:
.clients.Message
imported but unused (F401)Remove unused import
104-104:
.clients.Project
imported but unused (F401)Remove unused import
105-105:
.clients.ProjectsResponse
imported but unused (F401)Remove unused import
106-106:
.clients.MembersResponse
imported but unused (F401)Remove unused import
107-107:
.clients.Key
imported but unused (F401)Remove unused import
108-108:
.clients.KeyResponse
imported but unused (F401)Remove unused import
109-109:
.clients.KeysResponse
imported but unused (F401)Remove unused import
110-110:
.clients.ScopesResponse
imported but unused (F401)Remove unused import
111-111:
.clients.InvitesResponse
imported but unused (F401)Remove unused import
112-112:
.clients.UsageRequest
imported but unused (F401)Remove unused import
113-113:
.clients.UsageRequestsResponse
imported but unused (F401)Remove unused import
114-114:
.clients.UsageSummaryResponse
imported but unused (F401)Remove unused import
115-115:
.clients.UsageFieldsResponse
imported but unused (F401)Remove unused import
116-116:
.clients.Balance
imported but unused (F401)Remove unused import
117-117:
.clients.BalancesResponse
imported but unused (F401)Remove unused import
122-122:
.clients.OnPremClient
imported but unused (F401)Remove unused import
123-123:
.clients.AsyncOnPremClient
imported but unused (F401)Remove unused import
124-124:
.clients.SelfHostedClient
imported but unused (F401)Remove unused import
125-125:
.clients.AsyncSelfHostedClient
imported but unused (F401)Remove unused import
129-129:
.options.ClientOptionsFromEnv
imported but unused (F401)Remove unused import:
.options.ClientOptionsFromEnv
130-130:
.errors.DeepgramApiKeyError
imported but unused (F401)Remove unused import:
.errors.DeepgramApiKeyError
deepgram/clients/speak/v1/async_client_stream.py
193-194: Use a single
if
statement instead of nestedif
statements (SIM102)deepgram/clients/live/v1/async_client.py
223-224: Use a single
if
statement instead of nestedif
statements (SIM102)
Additional comments not posted (12)
deepgram/clients/speak/v1/__init__.py (1)
6-7
: Imports are well-organized but consider usage documentation.The imports are correctly structured, but it would be beneficial to include comments or documentation on how these imports are intended to be used, especially since they are designed for external exposure.
Tools
Ruff
6-6:
.client_stream.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
7-7:
.async_client_stream.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/clients/speak/__init__.py (1)
16-16
: Consider documenting the use ofSpeakStreamEvents
.
SpeakStreamEvents
is imported but not documented within this file. Adding usage examples or a brief description can help developers understand its purpose better.Tools
Ruff
16-16:
.enums.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/clients/__init__.py (1)
68-73
: Imports are well-organized but consider usage documentation.The imports are correctly structured, but it would be beneficial to include comments or documentation on how these imports are intended to be used, especially since they are designed for external exposure.
Tools
Ruff
68-68:
.speak.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
69-69:
.speak.SpeakResponse
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.speak.SpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)
72-72:
.speak.AsyncSpeakStreamClient
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/__init__.py (1)
89-89
: Consider documenting the use ofSpeakStreamEvents
.
SpeakStreamEvents
is imported but not documented within this file. Adding usage examples or a brief description can help developers understand its purpose better.Tools
Ruff
89-89:
.client.SpeakStreamEvents
imported but unused; consider removing, adding to__all__
, or using a redundant alias (F401)deepgram/client.py (1)
241-253
: Implement properties for SpeakStream functionality correctly.The properties
speakstream
andasyncspeakstream
are implemented to return instances ofSpeakStreamClient
andAsyncSpeakStreamClient
. Ensure these are correctly integrated and tested.deepgram/clients/speak/v1/async_client_stream.py (5)
197-225
: Good implementation of the_emit
method.The method effectively manages asynchronous tasks and ensures they are awaited and cleared, which is crucial for preventing memory leaks and ensuring all tasks complete before proceeding.
421-473
: Consider reducing logging verbosity in thesend
method.Excessive logging, especially at spam levels, can impact performance. Consider reducing the verbosity to debug or info level.
- self._logger.spam("AsyncSpeakStreamClient.send ENTER") + self._logger.debug("AsyncSpeakStreamClient.send ENTER") - self._logger.spam("AsyncSpeakStreamClient.send LEAVE") + self._logger.debug("AsyncSpeakStreamClient.send LEAVE")
477-503
: Good implementation of theflush
method.The method correctly handles the state of the WebSocket and ensures that operations are only attempted when the socket is initialized.
506-553
: Well-implementedfinish
method.The method effectively manages task cancellation and handles exceptions appropriately, ensuring a graceful shutdown of the WebSocket connection.
554-596
: Effective management of WebSocket closure in_signal_exit
.The method correctly signals the exit event and manages the WebSocket closure, including handling various exceptions that might occur during the process.
deepgram/clients/live/v1/async_client.py (2)
242-248
: Enhance event emission with concurrent task handling.Creating tasks for each event handler and using
asyncio.gather
to wait for all tasks to complete allows for efficient concurrent processing. Ensure that exceptions in tasks are logged or handled appropriately to avoid silent failures.
386-386
: Improve graceful exit handling for WebSocket closures.Handling specific WebSocket close codes (1000, 1001) gracefully is a good practice. Consider reviewing if other close codes should also be handled similarly based on the application's requirements.
It looks like the blackformatter doesnt error the unit tests out. Will fix in this in a subsequent PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me!
Proposed changes
Summary by CodeRabbit
New Features
SpeakStreamClient
andAsyncSpeakStreamClient
classes.Bug Fixes
AsyncLiveClient
.Documentation
Refactor