From 9d42f95462f528d20730696b9f5d3e30e236c0e5 Mon Sep 17 00:00:00 2001 From: atacan Date: Sat, 15 Aug 2026 16:00:24 +0200 Subject: [PATCH] feat: update supported transcription models --- pyproject.toml | 2 +- src/__init__.py | 3 + src/speech_to_text/client.py | 18 +++--- src/speech_to_text/raw_client.py | 18 +++--- src/types/__init__.py | 3 + src/types/base_transcription_configuration.py | 4 +- .../open_transcription_model_identifier.py | 3 + src/types/speech_to_text_model.py | 4 +- src/types/transcription_model_identifier.py | 64 +++++++++---------- src/types/transcription_provider.py | 2 - 10 files changed, 61 insertions(+), 60 deletions(-) create mode 100644 src/types/open_transcription_model_identifier.py diff --git a/pyproject.toml b/pyproject.toml index 6e2b576..5c9d1f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "speechall" -version = "0.4.0" +version = "0.5.0" description = "Python SDK for Speechall API - Speech-to-text transcription service" readme = "README.md" requires-python = ">=3.8" diff --git a/src/__init__.py b/src/__init__.py index 79c4559..9a8176d 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -10,6 +10,7 @@ BaseTranscriptionConfiguration, ErrorResponse, ExactRule, + OpenTranscriptionModelIdentifier, RegexGroupRule, RegexGroupRuleFlagsItem, RegexRule, @@ -55,6 +56,7 @@ "GatewayTimeoutError": ".errors", "InternalServerError": ".errors", "NotFoundError": ".errors", + "OpenTranscriptionModelIdentifier": ".types", "PaymentRequiredError": ".errors", "RegexGroupRule": ".types", "RegexGroupRuleFlagsItem": ".types", @@ -117,6 +119,7 @@ def __dir__(): "GatewayTimeoutError", "InternalServerError", "NotFoundError", + "OpenTranscriptionModelIdentifier", "PaymentRequiredError", "RegexGroupRule", "RegexGroupRuleFlagsItem", diff --git a/src/speech_to_text/client.py b/src/speech_to_text/client.py index 213dec8..c16cb63 100644 --- a/src/speech_to_text/client.py +++ b/src/speech_to_text/client.py @@ -4,11 +4,11 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions +from ..types.open_transcription_model_identifier import OpenTranscriptionModelIdentifier from ..types.replacement_rule import ReplacementRule from ..types.speech_to_text_model import SpeechToTextModel from ..types.transcript_language_code import TranscriptLanguageCode from ..types.transcript_output_format import TranscriptOutputFormat -from ..types.transcription_model_identifier import TranscriptionModelIdentifier from ..types.transcription_response import TranscriptionResponse from .raw_client import AsyncRawSpeechToTextClient, RawSpeechToTextClient @@ -34,7 +34,7 @@ def with_raw_response(self) -> RawSpeechToTextClient: def transcribe( self, *, - model: TranscriptionModelIdentifier, + model: OpenTranscriptionModelIdentifier, request: typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]], language: typing.Optional[TranscriptLanguageCode] = None, output_format: typing.Optional[TranscriptOutputFormat] = None, @@ -54,7 +54,7 @@ def transcribe( Parameters ---------- - model : TranscriptionModelIdentifier + model : OpenTranscriptionModelIdentifier The identifier of the speech-to-text model to use for the transcription, in the format `provider.model`. See the `/speech-to-text-models` endpoint for available models. request : typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]] @@ -116,7 +116,7 @@ def transcribe_remote( self, *, file_url: str, - model: TranscriptionModelIdentifier, + model: OpenTranscriptionModelIdentifier, replacement_ruleset: typing.Optional[typing.Sequence[ReplacementRule]] = OMIT, language: typing.Optional[TranscriptLanguageCode] = OMIT, output_format: typing.Optional[TranscriptOutputFormat] = OMIT, @@ -139,7 +139,7 @@ def transcribe_remote( file_url : str The publicly accessible URL of the audio file to transcribe. The API server must be able to fetch the audio from this URL. - model : TranscriptionModelIdentifier + model : OpenTranscriptionModelIdentifier The identifier of the speech-to-text model to use. replacement_ruleset : typing.Optional[typing.Sequence[ReplacementRule]] @@ -264,7 +264,7 @@ def with_raw_response(self) -> AsyncRawSpeechToTextClient: async def transcribe( self, *, - model: TranscriptionModelIdentifier, + model: OpenTranscriptionModelIdentifier, request: typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]], language: typing.Optional[TranscriptLanguageCode] = None, output_format: typing.Optional[TranscriptOutputFormat] = None, @@ -284,7 +284,7 @@ async def transcribe( Parameters ---------- - model : TranscriptionModelIdentifier + model : OpenTranscriptionModelIdentifier The identifier of the speech-to-text model to use for the transcription, in the format `provider.model`. See the `/speech-to-text-models` endpoint for available models. request : typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]] @@ -346,7 +346,7 @@ async def transcribe_remote( self, *, file_url: str, - model: TranscriptionModelIdentifier, + model: OpenTranscriptionModelIdentifier, replacement_ruleset: typing.Optional[typing.Sequence[ReplacementRule]] = OMIT, language: typing.Optional[TranscriptLanguageCode] = OMIT, output_format: typing.Optional[TranscriptOutputFormat] = OMIT, @@ -369,7 +369,7 @@ async def transcribe_remote( file_url : str The publicly accessible URL of the audio file to transcribe. The API server must be able to fetch the audio from this URL. - model : TranscriptionModelIdentifier + model : OpenTranscriptionModelIdentifier The identifier of the speech-to-text model to use. replacement_ruleset : typing.Optional[typing.Sequence[ReplacementRule]] diff --git a/src/speech_to_text/raw_client.py b/src/speech_to_text/raw_client.py index ba759ea..949b3f7 100644 --- a/src/speech_to_text/raw_client.py +++ b/src/speech_to_text/raw_client.py @@ -18,11 +18,11 @@ from ..errors.too_many_requests_error import TooManyRequestsError from ..errors.unauthorized_error import UnauthorizedError from ..types.error_response import ErrorResponse +from ..types.open_transcription_model_identifier import OpenTranscriptionModelIdentifier from ..types.replacement_rule import ReplacementRule from ..types.speech_to_text_model import SpeechToTextModel from ..types.transcript_language_code import TranscriptLanguageCode from ..types.transcript_output_format import TranscriptOutputFormat -from ..types.transcription_model_identifier import TranscriptionModelIdentifier from ..types.transcription_response import TranscriptionResponse # this is used as the default value for optional parameters @@ -36,7 +36,7 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def transcribe( self, *, - model: TranscriptionModelIdentifier, + model: OpenTranscriptionModelIdentifier, request: typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]], language: typing.Optional[TranscriptLanguageCode] = None, output_format: typing.Optional[TranscriptOutputFormat] = None, @@ -56,7 +56,7 @@ def transcribe( Parameters ---------- - model : TranscriptionModelIdentifier + model : OpenTranscriptionModelIdentifier The identifier of the speech-to-text model to use for the transcription, in the format `provider.model`. See the `/speech-to-text-models` endpoint for available models. request : typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]] @@ -227,7 +227,7 @@ def transcribe_remote( self, *, file_url: str, - model: TranscriptionModelIdentifier, + model: OpenTranscriptionModelIdentifier, replacement_ruleset: typing.Optional[typing.Sequence[ReplacementRule]] = OMIT, language: typing.Optional[TranscriptLanguageCode] = OMIT, output_format: typing.Optional[TranscriptOutputFormat] = OMIT, @@ -250,7 +250,7 @@ def transcribe_remote( file_url : str The publicly accessible URL of the audio file to transcribe. The API server must be able to fetch the audio from this URL. - model : TranscriptionModelIdentifier + model : OpenTranscriptionModelIdentifier The identifier of the speech-to-text model to use. replacement_ruleset : typing.Optional[typing.Sequence[ReplacementRule]] @@ -556,7 +556,7 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def transcribe( self, *, - model: TranscriptionModelIdentifier, + model: OpenTranscriptionModelIdentifier, request: typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]], language: typing.Optional[TranscriptLanguageCode] = None, output_format: typing.Optional[TranscriptOutputFormat] = None, @@ -576,7 +576,7 @@ async def transcribe( Parameters ---------- - model : TranscriptionModelIdentifier + model : OpenTranscriptionModelIdentifier The identifier of the speech-to-text model to use for the transcription, in the format `provider.model`. See the `/speech-to-text-models` endpoint for available models. request : typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]] @@ -747,7 +747,7 @@ async def transcribe_remote( self, *, file_url: str, - model: TranscriptionModelIdentifier, + model: OpenTranscriptionModelIdentifier, replacement_ruleset: typing.Optional[typing.Sequence[ReplacementRule]] = OMIT, language: typing.Optional[TranscriptLanguageCode] = OMIT, output_format: typing.Optional[TranscriptOutputFormat] = OMIT, @@ -770,7 +770,7 @@ async def transcribe_remote( file_url : str The publicly accessible URL of the audio file to transcribe. The API server must be able to fetch the audio from this URL. - model : TranscriptionModelIdentifier + model : OpenTranscriptionModelIdentifier The identifier of the speech-to-text model to use. replacement_ruleset : typing.Optional[typing.Sequence[ReplacementRule]] diff --git a/src/types/__init__.py b/src/types/__init__.py index f922967..03a0fae 100644 --- a/src/types/__init__.py +++ b/src/types/__init__.py @@ -9,6 +9,7 @@ from .base_transcription_configuration import BaseTranscriptionConfiguration from .error_response import ErrorResponse from .exact_rule import ExactRule + from .open_transcription_model_identifier import OpenTranscriptionModelIdentifier from .regex_group_rule import RegexGroupRule from .regex_group_rule_flags_item import RegexGroupRuleFlagsItem from .regex_rule import RegexRule @@ -35,6 +36,7 @@ "BaseTranscriptionConfiguration": ".base_transcription_configuration", "ErrorResponse": ".error_response", "ExactRule": ".exact_rule", + "OpenTranscriptionModelIdentifier": ".open_transcription_model_identifier", "RegexGroupRule": ".regex_group_rule", "RegexGroupRuleFlagsItem": ".regex_group_rule_flags_item", "RegexRule": ".regex_rule", @@ -83,6 +85,7 @@ def __dir__(): "BaseTranscriptionConfiguration", "ErrorResponse", "ExactRule", + "OpenTranscriptionModelIdentifier", "RegexGroupRule", "RegexGroupRuleFlagsItem", "RegexRule", diff --git a/src/types/base_transcription_configuration.py b/src/types/base_transcription_configuration.py index 4418d54..3803b55 100644 --- a/src/types/base_transcription_configuration.py +++ b/src/types/base_transcription_configuration.py @@ -4,9 +4,9 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .open_transcription_model_identifier import OpenTranscriptionModelIdentifier from .transcript_language_code import TranscriptLanguageCode from .transcript_output_format import TranscriptOutputFormat -from .transcription_model_identifier import TranscriptionModelIdentifier class BaseTranscriptionConfiguration(UniversalBaseModel): @@ -14,7 +14,7 @@ class BaseTranscriptionConfiguration(UniversalBaseModel): Common configuration options for transcription, applicable to both direct uploads and remote URLs. """ - model: TranscriptionModelIdentifier = pydantic.Field() + model: OpenTranscriptionModelIdentifier = pydantic.Field() """ The identifier of the speech-to-text model to use. """ diff --git a/src/types/open_transcription_model_identifier.py b/src/types/open_transcription_model_identifier.py new file mode 100644 index 0000000..2f04a33 --- /dev/null +++ b/src/types/open_transcription_model_identifier.py @@ -0,0 +1,3 @@ +# This file was auto-generated by Fern from our API Definition. + +OpenTranscriptionModelIdentifier = str diff --git a/src/types/speech_to_text_model.py b/src/types/speech_to_text_model.py index 1093ab7..d215fb2 100644 --- a/src/types/speech_to_text_model.py +++ b/src/types/speech_to_text_model.py @@ -4,9 +4,9 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .open_transcription_model_identifier import OpenTranscriptionModelIdentifier from .speech_to_text_model_accuracy_tier import SpeechToTextModelAccuracyTier from .speech_to_text_model_model_type import SpeechToTextModelModelType -from .transcription_model_identifier import TranscriptionModelIdentifier from .transcription_provider import TranscriptionProvider @@ -15,7 +15,7 @@ class SpeechToTextModel(UniversalBaseModel): Describes an available speech-to-text model, its provider, capabilities, and characteristics. """ - id: TranscriptionModelIdentifier = pydantic.Field() + id: OpenTranscriptionModelIdentifier = pydantic.Field() """ The unique identifier for this model (`provider.model_name`). """ diff --git a/src/types/transcription_model_identifier.py b/src/types/transcription_model_identifier.py index 0dd4aa3..df2c58a 100644 --- a/src/types/transcription_model_identifier.py +++ b/src/types/transcription_model_identifier.py @@ -5,66 +5,60 @@ TranscriptionModelIdentifier = typing.Union[ typing.Literal[ "amazon.transcribe", - "assemblyai.universal", "assemblyai.universal-2", - "assemblyai.universal-3-pro", + "assemblyai.universal-3-5-pro", "azure.standard", "cloudflare.whisper", "cloudflare.whisper-large-v3-turbo", "cloudflare.whisper-tiny-en", - "deepgram.nova-3", - "deepgram.nova-3-general", - "deepgram.nova-3-medical", + "deepgram.base", + "deepgram.conversationalai", + "deepgram.enhanced", + "deepgram.enhanced-finance", + "deepgram.enhanced-general", + "deepgram.enhanced-meeting", + "deepgram.enhanced-phonecall", + "deepgram.finance", + "deepgram.meeting", + "deepgram.nova", "deepgram.nova-2", + "deepgram.nova-2-automotive", + "deepgram.nova-2-conversationalai", + "deepgram.nova-2-drivethru", + "deepgram.nova-2-finance", "deepgram.nova-2-general", + "deepgram.nova-2-medical", "deepgram.nova-2-meeting", - "deepgram.nova-2-finance", - "deepgram.nova-2-conversationalai", - "deepgram.nova-2-voicemail", "deepgram.nova-2-video", - "deepgram.nova-2-medical", - "deepgram.nova-2-drivethru", - "deepgram.nova-2-automotive", - "deepgram.nova", + "deepgram.nova-2-voicemail", + "deepgram.nova-3", + "deepgram.nova-3-general", + "deepgram.nova-3-medical", "deepgram.nova-general", - "deepgram.nova-phonecall", "deepgram.nova-medical", - "deepgram.enhanced", - "deepgram.enhanced-general", - "deepgram.enhanced-meeting", - "deepgram.enhanced-phonecall", - "deepgram.enhanced-finance", - "deepgram.base", - "deepgram.meeting", + "deepgram.nova-phonecall", "deepgram.phonecall", - "deepgram.finance", - "deepgram.conversationalai", - "deepgram.voicemail", "deepgram.video", + "deepgram.voicemail", "elevenlabs.scribe-v1", - "falai.cohere-transcribe", - "falai.nvidia-nemotron-asr-multilingual", - "falai.whisper", - "falai.wizper", - "fireworksai.whisper-v3", - "fireworksai.whisper-v3-turbo", + "elevenlabs.scribe-v2", + "gemini.gemini-2.5-flash", + "gemini.gemini-2.5-flash-lite", + "gemini.gemini-2.5-pro", "gladia.standard", "google.enhanced", "google.standard", - "gemini.gemini-2.5-pro", - "gemini.gemini-2.5-flash", - "gemini.gemini-2.5-flash-lite", "groq.whisper-large-v3", "groq.whisper-large-v3-turbo", "ibm.standard", "mistral.voxtral-mini", "mistral.voxtral-mini-v2", - "openai.whisper-1", - "openai.gpt-4o-transcribe", "openai.gpt-4o-mini-transcribe", + "openai.gpt-4o-transcribe", "openai.gpt-4o-transcribe-diarize", - "revai.machine", + "openai.whisper-1", "revai.fusion", + "revai.machine", "speechmatics.enhanced", "speechmatics.standard", ], diff --git a/src/types/transcription_provider.py b/src/types/transcription_provider.py index e942c72..086faa6 100644 --- a/src/types/transcription_provider.py +++ b/src/types/transcription_provider.py @@ -10,8 +10,6 @@ "cloudflare", "deepgram", "elevenlabs", - "falai", - "fireworksai", "gemini", "gladia", "google",