Skip to content

Commit fe57c24

Browse files
author
Soheyl
committed
fix: drop usage of Literal to fix typing_extensions/pydantic issue
1 parent 4fe0b62 commit fe57c24

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

assemblyai/types.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
except ImportError:
88
from pydantic.v1 import UUID4, BaseModel, BaseSettings, Extra, Field
99

10-
from typing_extensions import Literal, Self
10+
from typing_extensions import Self
1111

1212

1313
class AssemblyAIError(Exception):
@@ -1607,9 +1607,8 @@ class RealtimeSessionOpened(BaseModel):
16071607
Once a real-time session is opened, the client will receive this message
16081608
"""
16091609

1610-
message_type: Literal[
1611-
RealtimeMessageTypes.session_begins
1612-
] = RealtimeMessageTypes.session_begins
1610+
message_type: RealtimeMessageTypes
1611+
16131612

16141613
session_id: UUID4
16151614
"Unique identifier for the established session."
@@ -1641,9 +1640,7 @@ class RealtimeTranscript(BaseModel):
16411640
Base class for real-time transcript messages.
16421641
"""
16431642

1644-
message_type: Literal[
1645-
RealtimeMessageTypes.partial_transcript, RealtimeMessageTypes.final_transcript
1646-
]
1643+
message_type: RealtimeMessageTypes
16471644
"Describes the type of message"
16481645

16491646
audio_start: int
@@ -1674,9 +1671,7 @@ class RealtimePartialTranscript(RealtimeTranscript):
16741671
As you send audio data to the service, the service will immediately start responding with partial transcripts.
16751672
"""
16761673

1677-
message_type: Literal[
1678-
RealtimeMessageTypes.partial_transcript
1679-
] = RealtimeMessageTypes.partial_transcript
1674+
message_type: RealtimeMessageTypes
16801675

16811676

16821677
class RealtimeFinalTranscript(RealtimeTranscript):
@@ -1686,9 +1681,7 @@ class RealtimeFinalTranscript(RealtimeTranscript):
16861681
sent to you so far with higher accuracy, as well as add punctuation and casing to the transcription text.
16871682
"""
16881683

1689-
message_type: Literal[
1690-
RealtimeMessageTypes.final_transcript
1691-
] = RealtimeMessageTypes.final_transcript
1684+
message_type: RealtimeMessageTypes
16921685

16931686
punctuated: bool
16941687
"Whether the transcript has been punctuated and cased"

0 commit comments

Comments
 (0)