From 636436f1610569f47a5e4beb369a198b0d14b2b2 Mon Sep 17 00:00:00 2001 From: Marcus Olsson <8396880+marcusolsson@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:52:21 +0100 Subject: [PATCH 1/8] fix(spec, sdk): remove references of Claude 1 and Basic models (#7201) GitOrigin-RevId: ad669bfbc9b07a31d10cde02894e2b65010e4403 --- .github/workflows/test.yml | 1 + assemblyai/__version__.py | 2 +- assemblyai/types.py | 35 ++--------------------------------- 3 files changed, 4 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 48f696f..1f4a614 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,6 +19,7 @@ jobs: - "3.11" - "3.10" - "3.9" + - "3.8" os: - ubuntu-22.04 steps: diff --git a/assemblyai/__version__.py b/assemblyai/__version__.py index e72781a..d9f2629 100644 --- a/assemblyai/__version__.py +++ b/assemblyai/__version__.py @@ -1 +1 @@ -__version__ = "0.39.0" +__version__ = "0.36.0" diff --git a/assemblyai/types.py b/assemblyai/types.py index 0dbf69e..1fb9c3c 100644 --- a/assemblyai/types.py +++ b/assemblyai/types.py @@ -1,16 +1,6 @@ from datetime import datetime from enum import Enum, EnumMeta -from typing import ( - TYPE_CHECKING, - Annotated, - Any, - Dict, - List, - Optional, - Sequence, - Tuple, - Union, -) +from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Tuple, Union from urllib.parse import parse_qs, urlparse from warnings import warn @@ -482,9 +472,6 @@ class SpeechModel(str, Enum): nano = "nano" "A lightweight, lower cost model for a wide range of languages." - slam_1 = "slam-1" - "A Speech Language Model optimized explicitly for speech-to-text tasks" - class RawTranscriptionConfig(BaseModel): language_code: Optional[Union[str, LanguageCode]] = None @@ -1718,12 +1705,6 @@ class BaseTranscript(BaseModel): speech_model: Optional[SpeechModel] = None "The speech model to use for the transcription." - prompt: Optional[str] = None - "The prompt used to generate the transcript with the Slam-1 speech model. Can't be used together with `keyterms_prompt`." - - keyterms_prompt: Optional[List[str]] = None - "The list of key terms used to generate the transcript with the Slam-1 speech model. Can't be used together with `prompt`." - class TranscriptRequest(BaseTranscript): """ @@ -1789,12 +1770,6 @@ class TranscriptResponse(BaseTranscript): speech_model: Optional[SpeechModel] = None "The speech model used for the transcription" - prompt: Optional[str] = None - "When Slam-1 is enabled, the prompt used to generate the transcript" - - keyterms_prompt: Optional[List[str]] = None - "When Slam-1 is enabled, the list of key terms used to generate the transcript" - def __init__(self, **data: Any): # cleanup the response before creating the object if not data.get("iab_categories_result") or ( @@ -1832,14 +1807,8 @@ class ListTranscriptParameters(BaseModel): status: Optional[TranscriptStatus] = None "Filter by transcript status" - throttled_only: Annotated[ - Optional[bool], - Field( - deprecated="`throttled_only` is deprecated and will be removed in a future release.", - ), - ] = None + throttled_only: Optional[bool] = None "Get only throttled transcripts, overrides the status filter" - model_config = ConfigDict(use_enum_values=True) From c0d3ab0249ca6776f19830beb96a152253738f6b Mon Sep 17 00:00:00 2001 From: Marcus Olsson <8396880+marcusolsson@users.noreply.github.com> Date: Wed, 29 Jan 2025 14:05:21 +0100 Subject: [PATCH 2/8] fix(sdk): Bump versions for Python, Go, and Typescript (#7981) GitOrigin-RevId: 0c4b5b870ed3cb099c8f163d0acd839e6d6413a4 --- assemblyai/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assemblyai/__version__.py b/assemblyai/__version__.py index d9f2629..2d93b0c 100644 --- a/assemblyai/__version__.py +++ b/assemblyai/__version__.py @@ -1 +1 @@ -__version__ = "0.36.0" +__version__ = "0.37.0" From be4f47e457d58beee75ff60ec31fd5bf46a14e27 Mon Sep 17 00:00:00 2001 From: Marcus Olsson <8396880+marcusolsson@users.noreply.github.com> Date: Fri, 7 Mar 2025 14:15:23 +0100 Subject: [PATCH 3/8] fix(sdk): Add slam-1 to SDKs (#8712) GitOrigin-RevId: 601d38d4d831e61415895c4b402b5b1dec32c862 --- assemblyai/types.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assemblyai/types.py b/assemblyai/types.py index 1fb9c3c..8141ff8 100644 --- a/assemblyai/types.py +++ b/assemblyai/types.py @@ -472,6 +472,9 @@ class SpeechModel(str, Enum): nano = "nano" "A lightweight, lower cost model for a wide range of languages." + slam_1 = "slam-1" + "A Speech Language Model optimized explicitly for speech-to-text tasks" + class RawTranscriptionConfig(BaseModel): language_code: Optional[Union[str, LanguageCode]] = None From 684469a11345711f19475ac7be9c56ec8addd5f6 Mon Sep 17 00:00:00 2001 From: Marcus Olsson <8396880+marcusolsson@users.noreply.github.com> Date: Mon, 10 Mar 2025 16:10:25 +0100 Subject: [PATCH 4/8] fix(sdk/python): Deprecate throttled_only (#8705) GitOrigin-RevId: 7c49c9d925bea3b81fe7f5be5749355c1bc8a051 --- assemblyai/types.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/assemblyai/types.py b/assemblyai/types.py index 8141ff8..8767201 100644 --- a/assemblyai/types.py +++ b/assemblyai/types.py @@ -1,6 +1,16 @@ from datetime import datetime from enum import Enum, EnumMeta -from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Tuple, Union +from typing import ( + TYPE_CHECKING, + Annotated, + Any, + Dict, + List, + Optional, + Sequence, + Tuple, + Union, +) from urllib.parse import parse_qs, urlparse from warnings import warn @@ -1810,8 +1820,15 @@ class ListTranscriptParameters(BaseModel): status: Optional[TranscriptStatus] = None "Filter by transcript status" - throttled_only: Optional[bool] = None + throttled_only: Annotated[ + Optional[bool], + Field( + default=None, + deprecated="`throttled_only` is deprecated and will be removed in a future release.", + ), + ] "Get only throttled transcripts, overrides the status filter" + model_config = ConfigDict(use_enum_values=True) From cc1113e41cdeb0df330fd95a6fd51ae1b4d44442 Mon Sep 17 00:00:00 2001 From: Marcus Olsson <8396880+marcusolsson@users.noreply.github.com> Date: Thu, 20 Mar 2025 16:37:01 +0100 Subject: [PATCH 5/8] chore(sdk): bump sdk versions (#9037) GitOrigin-RevId: 8b35dc2dc984b8361db7a081dea54b149238f733 --- assemblyai/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assemblyai/__version__.py b/assemblyai/__version__.py index 2d93b0c..978180b 100644 --- a/assemblyai/__version__.py +++ b/assemblyai/__version__.py @@ -1 +1 @@ -__version__ = "0.37.0" +__version__ = "0.38.0" From c336c4b42b8c2272ac881a413a6e2823a1dd8aa1 Mon Sep 17 00:00:00 2001 From: Marcus Olsson <8396880+marcusolsson@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:57:54 +0200 Subject: [PATCH 6/8] feat(sdk): add prompt and keyterms_prompt attributes to sdks (#9565) GitOrigin-RevId: e11821742e766f34b1c4e748ea5b676a3b0482b4 --- assemblyai/__version__.py | 2 +- assemblyai/types.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/assemblyai/__version__.py b/assemblyai/__version__.py index 978180b..e72781a 100644 --- a/assemblyai/__version__.py +++ b/assemblyai/__version__.py @@ -1 +1 @@ -__version__ = "0.38.0" +__version__ = "0.39.0" diff --git a/assemblyai/types.py b/assemblyai/types.py index 8767201..12b7462 100644 --- a/assemblyai/types.py +++ b/assemblyai/types.py @@ -1718,6 +1718,12 @@ class BaseTranscript(BaseModel): speech_model: Optional[SpeechModel] = None "The speech model to use for the transcription." + prompt: Optional[str] = None + "The prompt used to generate the transcript with the Slam-1 speech model. Can't be used together with `keyterms_prompt`." + + keyterms_prompt: Optional[List[str]] = None + "The list of key terms used to generate the transcript with the Slam-1 speech model. Can't be used together with `prompt`." + class TranscriptRequest(BaseTranscript): """ @@ -1783,6 +1789,12 @@ class TranscriptResponse(BaseTranscript): speech_model: Optional[SpeechModel] = None "The speech model used for the transcription" + prompt: Optional[str] = None + "When Slam-1 is enabled, the prompt used to generate the transcript" + + keyterms_prompt: Optional[List[str]] = None + "When Slam-1 is enabled, the list of key terms used to generate the transcript" + def __init__(self, **data: Any): # cleanup the response before creating the object if not data.get("iab_categories_result") or ( From cd55ff34165fef3c14ca379020e26ab1eb3bf4cf Mon Sep 17 00:00:00 2001 From: Marcus Olsson <8396880+marcusolsson@users.noreply.github.com> Date: Wed, 23 Apr 2025 11:17:10 +0200 Subject: [PATCH 7/8] feat(sdk/python): add prompt and keyterms_prompt to python sdk (#9664) GitOrigin-RevId: 095507d6772acf0adc157a1a1cd321b8ccdfdd76 --- assemblyai/__version__.py | 2 +- assemblyai/types.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/assemblyai/__version__.py b/assemblyai/__version__.py index e72781a..9442842 100644 --- a/assemblyai/__version__.py +++ b/assemblyai/__version__.py @@ -1 +1 @@ -__version__ = "0.39.0" +__version__ = "0.39.1" diff --git a/assemblyai/types.py b/assemblyai/types.py index 12b7462..78990b7 100644 --- a/assemblyai/types.py +++ b/assemblyai/types.py @@ -597,6 +597,13 @@ class RawTranscriptionConfig(BaseModel): """ The speech model to use for the transcription. """ + + prompt: Optional[str] = None + "The prompt used to generate the transcript with the Slam-1 speech model. Can't be used together with `keyterms_prompt`." + + keyterms_prompt: Optional[List[str]] = None + "The list of key terms used to generate the transcript with the Slam-1 speech model. Can't be used together with `prompt`." + model_config = ConfigDict(extra="allow") @@ -640,6 +647,8 @@ def __init__( speech_threshold: Optional[float] = None, raw_transcription_config: Optional[RawTranscriptionConfig] = None, speech_model: Optional[SpeechModel] = None, + prompt: Optional[str] = None, + keyterms_prompt: Optional[List[str]] = None, ) -> None: """ Args: @@ -728,6 +737,8 @@ def __init__( self.language_confidence_threshold = language_confidence_threshold self.speech_threshold = speech_threshold self.speech_model = speech_model + self.prompt = prompt + self.keyterms_prompt = keyterms_prompt @property def raw(self) -> RawTranscriptionConfig: @@ -756,6 +767,26 @@ def speech_model(self, speech_model: Optional[SpeechModel]) -> None: "Sets the speech model to use for the transcription." self._raw_transcription_config.speech_model = speech_model + @property + def prompt(self) -> Optional[str]: + "The prompt to use for the transcription." + return self._raw_transcription_config.prompt + + @prompt.setter + def prompt(self, prompt: Optional[str]) -> None: + "Sets the prompt to use for the transcription." + self._raw_transcription_config.prompt = prompt + + @property + def keyterms_prompt(self) -> Optional[List[str]]: + "The keyterms_prompt to use for the transcription." + return self._raw_transcription_config.keyterms_prompt + + @keyterms_prompt.setter + def keyterms_prompt(self, keyterms_prompt: Optional[List[str]]) -> None: + "Sets the prompt to use for the transcription." + self._raw_transcription_config.keyterms_prompt = keyterms_prompt + @property def punctuate(self) -> Optional[bool]: "Returns the status of the Automatic Punctuation feature." From f6e94267c6d8cbabfcb1960a07a6d8017e953321 Mon Sep 17 00:00:00 2001 From: Marcus Olsson <8396880+marcusolsson@users.noreply.github.com> Date: Wed, 23 Apr 2025 11:24:03 +0200 Subject: [PATCH 8/8] Fix missing changes --- .github/workflows/test.yml | 1 - assemblyai/types.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1f4a614..48f696f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,6 @@ jobs: - "3.11" - "3.10" - "3.9" - - "3.8" os: - ubuntu-22.04 steps: diff --git a/assemblyai/types.py b/assemblyai/types.py index 78990b7..4751f1d 100644 --- a/assemblyai/types.py +++ b/assemblyai/types.py @@ -1866,10 +1866,9 @@ class ListTranscriptParameters(BaseModel): throttled_only: Annotated[ Optional[bool], Field( - default=None, deprecated="`throttled_only` is deprecated and will be removed in a future release.", ), - ] + ] = None "Get only throttled transcripts, overrides the status filter" model_config = ConfigDict(use_enum_values=True)