Skip to content
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

Expose All Response Types/Objects #464

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 137 additions & 19 deletions deepgram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,32 @@
StreamSource,
FileSource,
UrlSource,
)
from .client import BaseResponse
from .client import (
Average,
Intent,
Intents,
IntentsInfo,
Segment,
SentimentInfo,
Sentiment,
Sentiments,
SummaryInfo,
Topic,
Topics,
TopicsInfo,
)
from .client import (
ModelInfo,
Alternative,
Hit,
Search,
Channel,
Word,
)
from .client import (
OpenResponse,
MetadataResponse,
CloseResponse,
UnhandledResponse,
ErrorResponse,
Expand All @@ -59,30 +80,77 @@
from .client import LiveTranscriptionEvents
from .client import LiveOptions, ListenWebSocketOptions
from .client import (
# OpenResponse,
#### top level
LiveResultResponse,
# MetadataResponse,
ListenWSMetadataResponse,
SpeechStartedResponse,
UtteranceEndResponse,
#### common websocket response
# OpenResponse,
# CloseResponse,
# UnhandledResponse,
# ErrorResponse,
#### unique
ListenWSMetadata,
)

# prerecorded
from .client import PreRecordedClient, AsyncPreRecordedClient # backward compat
from .client import ListenRESTClient, AsyncListenRESTClient
from .client import (
ListenRESTOptions,
PrerecordedOptions,
# common
# UrlSource,
# BufferSource,
# StreamSource,
# TextSource,
# FileSource,
# unique
PreRecordedStreamSource,
PrerecordedSource,
ListenRestSource,
SpeakRESTSource,
)
from .client import (
ListenRESTOptions,
PrerecordedOptions,
)
from .client import (
#### top level
AsyncPrerecordedResponse,
PrerecordedResponse,
SyncPrerecordedResponse,
#### shared
# Average,
# Intent,
# Intents,
# IntentsInfo,
# Segment,
# SentimentInfo,
# Sentiment,
# Sentiments,
# SummaryInfo,
# Topic,
# Topics,
# TopicsInfo,
#### unique
Alternative,
Channel,
Entity,
Hit,
ListenRESTMetadata,
ModelInfo,
Paragraph,
Paragraphs,
ListenRESTResults,
Search,
Sentence,
Summaries,
SummaryV1,
SummaryV2,
Translation,
Utterance,
Warning,
Word,
)

# read
Expand All @@ -94,23 +162,45 @@
AnalyzeSource,
)
from .client import (
#### top level
AsyncAnalyzeResponse,
AnalyzeResponse,
SyncAnalyzeResponse,
AnalyzeResponse,
#### shared
# Average,
# Intent,
# Intents,
# IntentsInfo,
# Segment,
# SentimentInfo,
# Sentiment,
# Sentiments,
# SummaryInfo,
# Topic,
# Topics,
# TopicsInfo,
#### unique
AnalyzeMetadata,
AnalyzeResults,
AnalyzeSummary,
)

# speak
## speak REST
from .client import (
SpeakOptions,
#### top level
SpeakRESTOptions,
SpeakWSOptions,
SpeakOptions, # backward compat
#### common
# TextSource,
# BufferSource,
# StreamSource,
# FileSource,
SpeakRestSource,
#### unique
SpeakSource,
SpeakRestSource,
)
from .client import SpeakWebSocketEvents, SpeakWebSocketMessage

## speak REST
from .client import (
SpeakClient, # backward compat
SpeakRESTClient,
Expand All @@ -123,20 +213,29 @@
)

## speak WebSocket
from .client import SpeakWebSocketEvents, SpeakWebSocketMessage

from .client import (
SpeakWSOptions,
)

from .client import (
SpeakWebSocketClient,
AsyncSpeakWebSocketClient,
SpeakWSClient,
AsyncSpeakWSClient,
)

from .client import (
# OpenResponse,
# MetadataResponse,
#### top level
SpeakWSMetadataResponse,
FlushedResponse,
ClearedResponse,
WarningResponse,
#### common websocket response
# OpenResponse,
# CloseResponse,
# UnhandledResponse,
WarningResponse,
# ErrorResponse,
)

Expand All @@ -154,23 +253,42 @@

# manage client responses
from .client import (
#### top level
Message,
Project,
ProjectsResponse,
ModelResponse,
ModelsResponse,
MembersResponse,
Key,
KeyResponse,
KeysResponse,
ScopesResponse,
InvitesResponse,
UsageRequest,
UsageResponse,
UsageRequestsResponse,
UsageSummaryResponse,
UsageFieldsResponse,
Balance,
BalancesResponse,
ModelsResponse,
ModelResponse,
#### shared
Project,
STTDetails,
TTSMetadata,
TTSDetails,
Member,
Key,
Invite,
Config,
STTUsageDetails,
Callback,
TokenDetail,
SpeechSegment,
TTSUsageDetails,
STTTokens,
TTSTokens,
UsageSummaryResults,
Resolution,
UsageModel,
Balance,
)

# selfhosted
Expand Down
2 changes: 1 addition & 1 deletion deepgram/audio/microphone/microphone.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(
chunk: int = CHUNK,
channels: int = CHANNELS,
input_device_index: Optional[int] = None,
):
): # pylint: disable=too-many-positional-arguments
# dynamic import of pyaudio as not to force the requirements on the SDK (and users)
import pyaudio # pylint: disable=import-outside-toplevel

Expand Down
2 changes: 1 addition & 1 deletion deepgram/audio/speaker/speaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(
chunk: int = CHUNK,
channels: int = CHANNELS,
output_device_index: Optional[int] = None,
):
): # pylint: disable=too-many-positional-arguments
# dynamic import of pyaudio as not to force the requirements on the SDK (and users)
import pyaudio # pylint: disable=import-outside-toplevel

Expand Down
Loading
Loading