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
6 changes: 6 additions & 0 deletions assemblyai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
SpeechUnderstandingResponse,
StatusResult,
SummarizationModel,
SummarizationRequest,
SummarizationResponse,
SummarizationSection,
SummarizationType,
SyncSpeechModel,
SyncTranscriptError,
Expand Down Expand Up @@ -183,6 +186,9 @@ def __getattr__(name: str):
"SpeechUnderstandingResponse",
"StatusResult",
"SummarizationModel",
"SummarizationRequest",
"SummarizationResponse",
"SummarizationSection",
"SummarizationType",
"SyncSpeechModel",
"SyncTranscriber",
Expand Down
2 changes: 1 addition & 1 deletion assemblyai/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.6.4"
__version__ = "1.6.5"
66 changes: 66 additions & 0 deletions assemblyai/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,24 @@ class CustomFormattingRequest(BaseModel):
"Custom email format pattern (e.g., 'username@domain.com')"


class SummarizationRequest(BaseModel):
"""
Summarization configuration for speech understanding
"""

summary_type: Literal["bullets", "paragraph"]
"The format of the summary"

headline_length: Optional[int] = None
"Target word count for each chapter headline (5-15, default: 10)"

approximate_chapters: Optional[int] = None
"Override: Approximate number of chapters to split the transcript into"

effort: Optional[Literal["low", "medium"]] = None
"How much effort to spend on this task (default: 'low')"


class SpeechUnderstandingFeatureRequests(BaseModel):
"""
Speech understanding feature requests
Expand All @@ -757,6 +775,9 @@ class SpeechUnderstandingFeatureRequests(BaseModel):
custom_formatting: Optional[CustomFormattingRequest] = None
"Custom formatting configuration"

summarization: Optional[SummarizationRequest] = None
"Summarization configuration"


class SpeechUnderstandingRequest(BaseModel):
"""
Expand Down Expand Up @@ -815,6 +836,48 @@ class TranslationResponse(BaseModel):
"Status of the translation feature"


class SummarizationSection(BaseModel):
"""
A summarized section of the transcript
"""

start: int
"Start of the section, in milliseconds"

end: int
"End of the section, in milliseconds"

text: Optional[str] = None
"Section summary, when summary_type is 'paragraph'"

bullets: Optional[List[str]] = None
"Section summary, when summary_type is 'bullets'"

headline: Optional[str] = None
"Short headline describing the section"


class SummarizationResponse(BaseModel):
"""
Summarization response containing the chapter summaries
"""

status: str
"Status of the summarization feature"

summary: Optional[List[SummarizationSection]] = None
"Per-section summaries"

block_summary: Optional[str] = None
"Single summary covering the whole transcript"

summary_type: Optional[Literal["bullets", "paragraph"]] = None
"The summary type that was used"

effort: Optional[Literal["low", "medium"]] = None
"The effort level that was used"


class SpeechUnderstandingFeatureResponses(BaseModel):
"""
Speech understanding feature responses grouped together
Expand All @@ -829,6 +892,9 @@ class SpeechUnderstandingFeatureResponses(BaseModel):
custom_formatting: Optional[CustomFormattingResponse] = None
"Custom formatting results"

summarization: Optional[SummarizationResponse] = None
"Summarization results"


class SpeechUnderstandingResponse(BaseModel):
"""
Expand Down
Loading