Skip to content
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
68 changes: 2 additions & 66 deletions packages/sdk-js/src/v2/live/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export type LiveV2TranslationLanguageCode =
| 'yo'
| 'zh'

export type LiveV2TranslationModel = 'base' | 'enhanced'
export type LiveV2TranslationModel = 'base' | 'batch' | 'enhanced'

export interface LiveV2TranslationConfig {
/** Target language in `iso639-1` format you want the transcription translated to */
Expand Down Expand Up @@ -302,7 +302,7 @@ export interface LiveV2PostProcessingConfig {
summarization?: boolean
/** Summarization configuration, if `summarization` is enabled */
summarization_config?: LiveV2SummarizationConfig
/** If true, generates chapters for the whole transcription. */
/** Deprecated: this parameter is ignored. */
chapterization?: boolean
}

Expand Down Expand Up @@ -558,19 +558,6 @@ export interface LiveV2SentimentAnalysis {
results: string
}

export interface LiveV2Chapterization {
/** The audio intelligence model succeeded to get a valid output */
success: boolean
/** The audio intelligence model returned an empty value */
is_empty: boolean
/** Time audio intelligence model took to complete the task */
exec_time: number
/** `null` if `success` is `true`. Contains the error details of the failed model */
error: LiveV2AddonError | null
/** If `chapterization` has been enabled, will generate chapters name for different parts of the given audio. */
results: Record<string, any>
}

export interface LiveV2TranscriptionResultWithMessages {
/** Metadata for the given transcription & audio file */
metadata: LiveV2TranscriptionMetadata
Expand All @@ -584,8 +571,6 @@ export interface LiveV2TranscriptionResultWithMessages {
named_entity_recognition?: LiveV2NamedEntityRecognition
/** If `sentiment_analysis` has been enabled, sentiment analysis of the audio speech transcription */
sentiment_analysis?: LiveV2SentimentAnalysis
/** If `chapterization` has been enabled, will generate chapters name for different parts of the given audio. */
chapterization?: LiveV2Chapterization
/** Real-Time messages sent by the server during the live transcription */
messages?: Array<string>
}
Expand Down Expand Up @@ -629,31 +614,6 @@ export interface LiveV2NamedEntityRecognitionData {
results: Array<LiveV2NamedEntityRecognitionResult>
}

export interface LiveV2ChapterizationSentence {
sentence: string
start: number
end: number
words: Array<LiveV2Word>
}

export interface LiveV2PostChapterizationResult {
abstractive_summary?: string
extractive_summary?: string
summary?: string
headline: string
gist: string
keywords: Array<string>
start: number
end: number
sentences: Array<LiveV2ChapterizationSentence>
text: string
}

export interface LiveV2PostChapterizationMessageData {
/** The chapters */
results: Array<LiveV2PostChapterizationResult>
}

export interface LiveV2TranscriptionResult {
/** Metadata for the given transcription & audio file */
metadata: LiveV2TranscriptionMetadata
Expand All @@ -667,8 +627,6 @@ export interface LiveV2TranscriptionResult {
named_entity_recognition?: LiveV2NamedEntityRecognition
/** If `sentiment_analysis` has been enabled, sentiment analysis of the audio speech transcription */
sentiment_analysis?: LiveV2SentimentAnalysis
/** If `chapterization` has been enabled, will generate chapters name for different parts of the given audio. */
chapterization?: LiveV2Chapterization
}

export interface LiveV2PostSummarizationMessageData {
Expand Down Expand Up @@ -867,18 +825,6 @@ export interface LiveV2NamedEntityRecognitionMessage {
data: LiveV2NamedEntityRecognitionData | null
}

export interface LiveV2PostChapterizationMessage {
/** Id of the live session */
session_id: string
/** Date of creation of the message. The date is formatted as an ISO 8601 string */
created_at: string
/** Error message if the addon failed */
error: LiveV2Error | null
type: 'post_chapterization'
/** The message data. "null" if the addon failed */
data: LiveV2PostChapterizationMessageData | null
}

export interface LiveV2PostFinalTranscriptMessage {
/** Id of the live session */
session_id: string
Expand Down Expand Up @@ -990,7 +936,6 @@ export type LiveV2WebSocketMessage =
| LiveV2EndSessionMessage
| LiveV2TranslationMessage
| LiveV2NamedEntityRecognitionMessage
| LiveV2PostChapterizationMessage
| LiveV2PostFinalTranscriptMessage
| LiveV2PostSummarizationMessage
| LiveV2PostTranscriptMessage
Expand Down Expand Up @@ -1043,14 +988,6 @@ export interface LiveV2CallbackNamedEntityRecognitionMessage {
payload: LiveV2NamedEntityRecognitionMessage
}

export interface LiveV2CallbackPostChapterizationMessage {
/** Id of the job */
id: string
event: 'live.post_chapterization'
/** The live message payload as sent to the WebSocket */
payload: LiveV2PostChapterizationMessage
}

export interface LiveV2CallbackPostFinalTranscriptMessage {
/** Id of the job */
id: string
Expand Down Expand Up @@ -1138,7 +1075,6 @@ export type LiveV2CallbackMessage =
| LiveV2CallbackEndSessionMessage
| LiveV2CallbackTranslationMessage
| LiveV2CallbackNamedEntityRecognitionMessage
| LiveV2CallbackPostChapterizationMessage
| LiveV2CallbackPostFinalTranscriptMessage
| LiveV2CallbackPostSummarizationMessage
| LiveV2CallbackPostTranscriptMessage
Expand Down
27 changes: 9 additions & 18 deletions packages/sdk-js/src/v2/prerecorded/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export type PreRecordedV2TranslationLanguageCode =
| 'yo'
| 'zh'

export type PreRecordedV2TranslationModel = 'base' | 'enhanced'
export type PreRecordedV2TranslationModel = 'base' | 'batch' | 'enhanced'

export interface PreRecordedV2TranslationConfig {
/** Target language in `iso639-1` format you want the transcription translated to */
Expand Down Expand Up @@ -415,6 +415,8 @@ export interface PreRecordedV2LanguageConfig {
code_switching?: boolean
}

export type PreRecordedV2TranscriptionModel = 'solaria-1' | 'solaria-3' | 'solaria-fusion'

export interface PreRecordedV2FileResponse {
/** The file id */
id: string
Expand Down Expand Up @@ -477,6 +479,8 @@ export interface PreRecordedV2RequestParamsResponse {
punctuation_enhanced?: boolean
/** Specify the language configuration */
language_config?: PreRecordedV2LanguageConfig
/** The model used to process the audio. "solaria-1" is used by default. */
model?: PreRecordedV2TranscriptionModel
audio_url: string | null
}

Expand Down Expand Up @@ -647,7 +651,7 @@ export interface PreRecordedV2NamesConsistency {
/** `null` if `success` is `true`. Contains the error details of the failed model */
error: PreRecordedV2AddonError | null
/** Deprecated, If `name_consistency` has been enabled, Gladia will improve the consistency of the names across the transcription */
results: string
results: string | null
}

export interface PreRecordedV2StructuredDataExtraction {
Expand All @@ -660,7 +664,7 @@ export interface PreRecordedV2StructuredDataExtraction {
/** `null` if `success` is `true`. Contains the error details of the failed model */
error: PreRecordedV2AddonError | null
/** If `structured_data_extraction` has been enabled, results of the AI structured data extraction for the defined classes. */
results: string
results: string | null
}

export interface PreRecordedV2SentimentAnalysis {
Expand Down Expand Up @@ -722,19 +726,6 @@ export interface PreRecordedV2DisplayMode {
results: Array<string> | null
}

export interface PreRecordedV2Chapterization {
/** The audio intelligence model succeeded to get a valid output */
success: boolean
/** The audio intelligence model returned an empty value */
is_empty: boolean
/** Time audio intelligence model took to complete the task */
exec_time: number
/** `null` if `success` is `true`. Contains the error details of the failed model */
error: PreRecordedV2AddonError | null
/** If `chapterization` has been enabled, will generate chapters name for different parts of the given audio. */
results: Record<string, any>
}

export interface PreRecordedV2Diarization {
/** The audio intelligence model succeeded to get a valid output */
success: boolean
Expand Down Expand Up @@ -773,8 +764,6 @@ export interface PreRecordedV2TranscriptionResult {
sentences?: PreRecordedV2Sentences
/** If `display_mode` has been enabled, the output will be reordered, creating new utterances when speakers overlapped */
display_mode?: PreRecordedV2DisplayMode
/** If `chapterization` has been enabled, will generate chapters name for different parts of the given audio. */
chapterization?: PreRecordedV2Chapterization
/** If `diarization` has been requested and an error has occurred, the result will appear here */
diarization?: PreRecordedV2Diarization
}
Expand Down Expand Up @@ -845,6 +834,8 @@ export interface PreRecordedV2InitTranscriptionRequest {
punctuation_enhanced?: boolean
/** Specify the language configuration */
language_config?: PreRecordedV2LanguageConfig
/** The model used to process the audio. "solaria-1" is used by default. */
model?: PreRecordedV2TranscriptionModel
/** URL to a Gladia file or to an external audio or video file */
audio_url: string
}
Expand Down
79 changes: 2 additions & 77 deletions packages/sdk-python/src/gladiaio_sdk/v2/live/generated_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class LiveV2CustomSpellingConfig(BaseDataClass):
"zh",
]

LiveV2TranslationModel = Literal["base", "enhanced"]
LiveV2TranslationModel = Literal["base", "batch", "enhanced"]


@dataclass(frozen=True, slots=True)
Expand Down Expand Up @@ -341,7 +341,7 @@ class LiveV2PostProcessingConfig(BaseDataClass):
summarization: bool | None = None
# Summarization configuration, if `summarization` is enabled
summarization_config: LiveV2SummarizationConfig | None = None
# If true, generates chapters for the whole transcription.
# Deprecated: this parameter is ignored.
chapterization: bool | None = None


Expand Down Expand Up @@ -618,21 +618,6 @@ class LiveV2SentimentAnalysis(BaseDataClass):
error: LiveV2AddonError | None = None


@dataclass(frozen=True, slots=True)
class LiveV2Chapterization(BaseDataClass):
# The audio intelligence model succeeded to get a valid output
success: bool
# The audio intelligence model returned an empty value
is_empty: bool
# Time audio intelligence model took to complete the task
exec_time: float
# If `chapterization` has been enabled, will generate chapters name for different parts of the
# given audio.
results: dict[str, Any]
# `null` if `success` is `true`. Contains the error details of the failed model
error: LiveV2AddonError | None = None


@dataclass(frozen=True, slots=True)
class LiveV2TranscriptionResultWithMessages(BaseDataClass):
# Metadata for the given transcription & audio file
Expand All @@ -647,9 +632,6 @@ class LiveV2TranscriptionResultWithMessages(BaseDataClass):
named_entity_recognition: LiveV2NamedEntityRecognition | None = None
# If `sentiment_analysis` has been enabled, sentiment analysis of the audio speech transcription
sentiment_analysis: LiveV2SentimentAnalysis | None = None
# If `chapterization` has been enabled, will generate chapters name for different parts of the
# given audio.
chapterization: LiveV2Chapterization | None = None
# Real-Time messages sent by the server during the live transcription
messages: list[str] | None = None

Expand Down Expand Up @@ -698,34 +680,6 @@ class LiveV2NamedEntityRecognitionData(BaseDataClass):
results: list[LiveV2NamedEntityRecognitionResult]


@dataclass(frozen=True, slots=True)
class LiveV2ChapterizationSentence(BaseDataClass):
sentence: str
start: float
end: float
words: list[LiveV2Word]


@dataclass(frozen=True, slots=True)
class LiveV2PostChapterizationResult(BaseDataClass):
headline: str
gist: str
keywords: list[str]
start: float
end: float
sentences: list[LiveV2ChapterizationSentence]
text: str
abstractive_summary: str | None = None
extractive_summary: str | None = None
summary: str | None = None


@dataclass(frozen=True, slots=True)
class LiveV2PostChapterizationMessageData(BaseDataClass):
# The chapters
results: list[LiveV2PostChapterizationResult]


@dataclass(frozen=True, slots=True)
class LiveV2TranscriptionResult(BaseDataClass):
# Metadata for the given transcription & audio file
Expand All @@ -740,9 +694,6 @@ class LiveV2TranscriptionResult(BaseDataClass):
named_entity_recognition: LiveV2NamedEntityRecognition | None = None
# If `sentiment_analysis` has been enabled, sentiment analysis of the audio speech transcription
sentiment_analysis: LiveV2SentimentAnalysis | None = None
# If `chapterization` has been enabled, will generate chapters name for different parts of the
# given audio.
chapterization: LiveV2Chapterization | None = None


@dataclass(frozen=True, slots=True)
Expand Down Expand Up @@ -962,19 +913,6 @@ class LiveV2NamedEntityRecognitionMessage(BaseDataClass):
data: LiveV2NamedEntityRecognitionData | None = None


@dataclass(frozen=True, slots=True)
class LiveV2PostChapterizationMessage(BaseDataClass):
# Id of the live session
session_id: str
# Date of creation of the message. The date is formatted as an ISO 8601 string
created_at: str
type: Literal["post_chapterization"]
# Error message if the addon failed
error: LiveV2Error | None = None
# The message data. "null" if the addon failed
data: LiveV2PostChapterizationMessageData | None = None


@dataclass(frozen=True, slots=True)
class LiveV2PostFinalTranscriptMessage(BaseDataClass):
# Id of the live session
Expand Down Expand Up @@ -1096,7 +1034,6 @@ class LiveV2SpeechEndMessage(BaseDataClass):
| LiveV2EndSessionMessage
| LiveV2TranslationMessage
| LiveV2NamedEntityRecognitionMessage
| LiveV2PostChapterizationMessage
| LiveV2PostFinalTranscriptMessage
| LiveV2PostSummarizationMessage
| LiveV2PostTranscriptMessage
Expand All @@ -1114,7 +1051,6 @@ class LiveV2SpeechEndMessage(BaseDataClass):
"end_session": LiveV2EndSessionMessage,
"translation": LiveV2TranslationMessage,
"named_entity_recognition": LiveV2NamedEntityRecognitionMessage,
"post_chapterization": LiveV2PostChapterizationMessage,
"post_final_transcript": LiveV2PostFinalTranscriptMessage,
"post_summarization": LiveV2PostSummarizationMessage,
"post_transcript": LiveV2PostTranscriptMessage,
Expand Down Expand Up @@ -1198,15 +1134,6 @@ class LiveV2CallbackNamedEntityRecognitionMessage(BaseDataClass):
payload: LiveV2NamedEntityRecognitionMessage


@dataclass(frozen=True, slots=True)
class LiveV2CallbackPostChapterizationMessage(BaseDataClass):
# Id of the job
id: str
event: Literal["live.post_chapterization"]
# The live message payload as sent to the WebSocket
payload: LiveV2PostChapterizationMessage


@dataclass(frozen=True, slots=True)
class LiveV2CallbackPostFinalTranscriptMessage(BaseDataClass):
# Id of the job
Expand Down Expand Up @@ -1304,7 +1231,6 @@ class LiveV2CallbackSpeechEndMessage(BaseDataClass):
| LiveV2CallbackEndSessionMessage
| LiveV2CallbackTranslationMessage
| LiveV2CallbackNamedEntityRecognitionMessage
| LiveV2CallbackPostChapterizationMessage
| LiveV2CallbackPostFinalTranscriptMessage
| LiveV2CallbackPostSummarizationMessage
| LiveV2CallbackPostTranscriptMessage
Expand All @@ -1322,7 +1248,6 @@ class LiveV2CallbackSpeechEndMessage(BaseDataClass):
"live.end_session": LiveV2CallbackEndSessionMessage,
"live.translation": LiveV2CallbackTranslationMessage,
"live.named_entity_recognition": LiveV2CallbackNamedEntityRecognitionMessage,
"live.post_chapterization": LiveV2CallbackPostChapterizationMessage,
"live.post_final_transcript": LiveV2CallbackPostFinalTranscriptMessage,
"live.post_summarization": LiveV2CallbackPostSummarizationMessage,
"live.post_transcript": LiveV2CallbackPostTranscriptMessage,
Expand Down
Loading
Loading