Skip to content
Open
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
2 changes: 1 addition & 1 deletion assemblyai/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.6.1"
__version__ = "1.6.2"
3 changes: 2 additions & 1 deletion assemblyai/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,8 @@ class SummarizationModel(str, Enum):
Required Parameters:
- `punctuate`: `True`
- `format_text`: `True`
- `speaker_labels` or `dual_channel` set to `True`
- `speaker_labels`, `multichannel`, or `dual_channel` set to `True`
(`multichannel` is the recommended option; `dual_channel` is deprecated)
"""

catchy = "catchy"
Expand Down
47 changes: 47 additions & 0 deletions tests/unit/test_summarization.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,50 @@ def test_summarization_params_excluded_when_disabled(httpx_mock: HTTPXMock):
# Check that transcript was properly parsed from JSON response
assert transcript.error is None
assert transcript.summary is None


@pytest.mark.parametrize(
"speaker_separation_param",
[
{"multichannel": True},
{"speaker_labels": True},
{"dual_channel": True},
],
ids=["multichannel", "speaker_labels", "dual_channel"],
)
def test_conversational_summary_with_speaker_separation(
httpx_mock: HTTPXMock, speaker_separation_param: dict
):
"""
Tests that `summary_model=conversational` is accepted together with any of
the valid speaker-separation flags (`multichannel`, `speaker_labels`,
`dual_channel`) without a client-side error.

Regression test for https://github.com/AssemblyAI/assemblyai-node-sdk/issues/71 —
`multichannel=True` was previously undocumented as a valid alternative to
`speaker_labels`/`dual_channel` for conversational summaries.
"""
mock_response = factories.generate_dict_factory(SummarizationResponseFactory)()
request_body, transcript = test_utils.submit_mock_transcription_request(
httpx_mock,
mock_response,
aai.TranscriptionConfig(
summarization=True,
summary_model=aai.SummarizationModel.conversational,
summary_type=aai.SummarizationType.bullets,
**speaker_separation_param, # type: ignore[arg-type]
),
)

# The SDK must not raise before submitting
assert request_body.get("summarization") is True
assert request_body.get("summary_model") == aai.SummarizationModel.conversational
assert request_body.get("summary_type") == aai.SummarizationType.bullets

# The speaker-separation flag must be forwarded to the API
for key, value in speaker_separation_param.items():
assert request_body.get(key) == value

# Response must be parsed correctly
assert transcript.error is None
assert transcript.summary == mock_response["summary"]
Loading