Skip to content

Commit 1808f0f

Browse files
Merge pull request #297 from dvonthenen/fix-enum-serializable
Object of type Sentiment is not JSON serializable
2 parents a1ca02b + b96fddf commit 1808f0f

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

deepgram/clients/analyze/enums.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"""
1010

1111

12-
class Sentiment(Enum):
13-
UNKNOWN = ""
14-
NEGATIVE = "negative"
15-
NEUTRAL = "neutral"
16-
POSITIVE = "positive"
12+
class Sentiment(str, Enum):
13+
UNKNOWN: str = ""
14+
NEGATIVE: str = "negative"
15+
NEUTRAL: str = "neutral"
16+
POSITIVE: str = "positive"

deepgram/clients/live/enums.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"""
1010

1111

12-
class LiveTranscriptionEvents(Enum):
13-
Open = "Open"
14-
Close = "Close"
15-
Transcript = "Results"
16-
Metadata = "Metadata"
17-
UtteranceEnd = "UtteranceEnd"
18-
SpeechStarted = "SpeechStarted"
19-
Error = "Error"
20-
Warning = "Warning"
12+
class LiveTranscriptionEvents(str, Enum):
13+
Open: str = "Open"
14+
Close: str = "Close"
15+
Transcript: str = "Results"
16+
Metadata: str = "Metadata"
17+
UtteranceEnd: str = "UtteranceEnd"
18+
SpeechStarted: str = "SpeechStarted"
19+
Error: str = "Error"
20+
Warning: str = "Warning"

deepgram/clients/prerecorded/enums.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"""
1010

1111

12-
class Sentiment(Enum):
13-
UNKNOWN = ""
14-
NEGATIVE = "negative"
15-
NEUTRAL = "neutral"
16-
POSITIVE = "positive"
12+
class Sentiment(str, Enum):
13+
UNKNOWN: str = ""
14+
NEGATIVE: str = "negative"
15+
NEUTRAL: str = "neutral"
16+
POSITIVE: str = "positive"

0 commit comments

Comments
 (0)