Skip to content

Commit

Permalink
Merge pull request #464 from dvonthenen/issue457-expose-all-response-…
Browse files Browse the repository at this point in the history
…types

Expose All Response Types/Objects
  • Loading branch information
davidvonthenen authored Sep 24, 2024
2 parents 78c7c45 + 7973bcb commit ee4a581
Show file tree
Hide file tree
Showing 52 changed files with 1,740 additions and 1,287 deletions.
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

0 comments on commit ee4a581

Please sign in to comment.