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.1.tar.gz (14.9 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.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: genblaze_assemblyai-0.3.1.tar.gz
  • Upload date:
  • Size: 14.9 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.1.tar.gz
Algorithm Hash digest
SHA256 bcfb2b168d3812aef48838659ebe7c4deb4e4eb7c89767d8c51ec02ae18ffc36
MD5 6cfe72289135613ea7368a2e5cce99d3
BLAKE2b-256 f65cacdaf70af2413145a367e1674248698971b4e396e8c5644e1d033920e1b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for genblaze_assemblyai-0.3.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for genblaze_assemblyai-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6af1a2889cd9dd515ae53dcf3922697352208dc056a1b45793bed6457326d960
MD5 8325bef04ca4785b4da03f9ab7de8afb
BLAKE2b-256 8a346ee788045bdddf3014e2d2cd2c95e7a941a57b0a9683a512ed0ac48bddb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for genblaze_assemblyai-0.3.1-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