Skip to main content

AssemblyAI (speech-to-text / transcription) provider adapter for genblaze

Project description

genblaze-assemblyai

AssemblyAI speech-to-text / transcription provider adapter for genblaze.

This connector is the inverse of every other genblaze adapter: instead of generating media it consumes an audio URL and produces a text transcript with word-level timings. The transcript lands as a hash-verified TEXT asset with a provenance manifest, so it composes into pipelines (generate audio → transcribe, caption a generated video) and persists to Backblaze B2 / S3 like any other genblaze step.

Install

pip install genblaze-assemblyai      # or: pip install "genblaze[assemblyai]"
export ASSEMBLYAI_API_KEY="..."      # from https://www.assemblyai.com/app/api-keys

Usage

from genblaze_core import Modality, Pipeline
from genblaze_assemblyai import AssemblyAIProvider

run, manifest = (
    Pipeline("transcribe")
    .step(
        AssemblyAIProvider(),
        model="universal-3-pro",                       # speech_models: universal-3-pro | universal-2
        prompt="https://example.com/podcast-episode.mp3",  # or params={"audio_url": ...}, or a chained audio input
        modality=Modality.TEXT,
        speaker_labels=True,                           # any TranscriptionConfig flag passes through
    )
    .run()
)

asset = run.steps[0].assets[0]
print(asset.metadata["text"])          # the transcript
print(asset.audio.word_timings[:3])    # [WordTiming(word=..., start=..., end=...), ...] (seconds)
print(manifest.canonical_hash)

The audio URL is resolved from (in priority order) step.inputs[0].urlstep.params["audio_url"]step.prompt, then SSRF-validated (https:// or file:// only) before submission. step.model selects the AssemblyAI speech model (sent on the SDK's plural speech_models field — the live API retired the singular speech_model field and the best / nano aliases; current values are universal-3-pro / universal-2); every other TranscriptionConfig flag (speaker_labels, language_code, audio-intelligence options, …) passes through step.params.

Pricing

The SDK ships no hardcoded prices. AssemblyAI bills per minute of input audio; the connector captures the input duration in step.provider_payload["audio_duration"] (seconds) during fetch_output. Register a recipe at runtime — see docs/reference/pricing-recipes.md ("AssemblyAI" section):

from genblaze_core.providers import per_response_metric

RATE_PER_MINUTE = RATE  # replace RATE with the per-minute USD rate from assemblyai.com/pricing


def per_minute(ctx):
    seconds = ctx.provider_payload.get("audio_duration")
    return (seconds / 60.0) * RATE_PER_MINUTE if seconds is not None else None


provider = AssemblyAIProvider(api_key="...")
# Speech-model slugs match the connector's family, so register against the
# concrete slug(s) you use (register_pricing layers onto the family spec).
for slug in ("universal-3-pro", "universal-2"):
    provider.models.register_pricing(slug, per_response_metric(per_minute))

Notes

  • Out of scope for v1: real-time/streaming transcription, LeMUR (LLM-over-transcript), and first-class SRT/VTT subtitle outputs. Audio- intelligence flags pass through to the API and land in metadata.

Docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genblaze_assemblyai-0.3.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genblaze_assemblyai-0.3.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file genblaze_assemblyai-0.3.0.tar.gz.

File metadata

  • Download URL: genblaze_assemblyai-0.3.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for genblaze_assemblyai-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e1f4e45f7aded8faad1e31b9db14074838eeeccecb99836ea821d19725cba09e
MD5 2200ba0c9dfda5b5943ecbcd50b1f098
BLAKE2b-256 213914ec4776b60b01fe6e2647ebe6d87d9663e1f37d4e44b04ffb32da7e2bbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for genblaze_assemblyai-0.3.0.tar.gz:

Publisher: release.yml on backblaze-labs/genblaze

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file genblaze_assemblyai-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for genblaze_assemblyai-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 644794085aaeab523e6d4a924b4d093ccba459895ad471c63490a275f37cd484
MD5 e0b5742e184c9cf8226221736aae17cc
BLAKE2b-256 272f8b33784a3c5600265bbc1505d1d83cef3db53504c3b5b93f2c6481d8870d

See more details on using hashes here.

Provenance

The following attestation bundles were made for genblaze_assemblyai-0.3.0-py3-none-any.whl:

Publisher: release.yml on backblaze-labs/genblaze

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page