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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
BaseTranscriptionConfiguration,
ErrorResponse,
ExactRule,
OpenTranscriptionModelIdentifier,
RegexGroupRule,
RegexGroupRuleFlagsItem,
RegexRule,
Expand Down Expand Up @@ -55,6 +56,7 @@
"GatewayTimeoutError": ".errors",
"InternalServerError": ".errors",
"NotFoundError": ".errors",
"OpenTranscriptionModelIdentifier": ".types",
"PaymentRequiredError": ".errors",
"RegexGroupRule": ".types",
"RegexGroupRuleFlagsItem": ".types",
Expand Down Expand Up @@ -117,6 +119,7 @@ def __dir__():
"GatewayTimeoutError",
"InternalServerError",
"NotFoundError",
"OpenTranscriptionModelIdentifier",
"PaymentRequiredError",
"RegexGroupRule",
"RegexGroupRuleFlagsItem",
Expand Down
18 changes: 9 additions & 9 deletions src/speech_to_text/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
Expand All @@ -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]]
Expand Down Expand Up @@ -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,
Expand All @@ -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]]
Expand Down Expand Up @@ -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,
Expand All @@ -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]]
Expand Down Expand Up @@ -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,
Expand All @@ -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]]
Expand Down
18 changes: 9 additions & 9 deletions src/speech_to_text/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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]]
Expand Down Expand Up @@ -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,
Expand All @@ -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]]
Expand Down Expand Up @@ -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,
Expand All @@ -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]]
Expand Down Expand Up @@ -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,
Expand All @@ -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]]
Expand Down
3 changes: 3 additions & 0 deletions src/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -83,6 +85,7 @@ def __dir__():
"BaseTranscriptionConfiguration",
"ErrorResponse",
"ExactRule",
"OpenTranscriptionModelIdentifier",
"RegexGroupRule",
"RegexGroupRuleFlagsItem",
"RegexRule",
Expand Down
4 changes: 2 additions & 2 deletions src/types/base_transcription_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

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):
"""
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.
"""
Expand Down
3 changes: 3 additions & 0 deletions src/types/open_transcription_model_identifier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file was auto-generated by Fern from our API Definition.

OpenTranscriptionModelIdentifier = str
4 changes: 2 additions & 2 deletions src/types/speech_to_text_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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`).
"""
Expand Down
64 changes: 29 additions & 35 deletions src/types/transcription_model_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
2 changes: 0 additions & 2 deletions src/types/transcription_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"cloudflare",
"deepgram",
"elevenlabs",
"falai",
"fireworksai",
"gemini",
"gladia",
"google",
Expand Down
Loading