{"record":{"id":"17f22f9191b886d1","repo":"langchain-ai/deepagents","slug":"local-voice-transcription-dependencies-are-missing","errorCode":null,"errorMessage":"Local voice transcription dependencies are missing. Install the `media` extra and ensure ffmpeg is on PATH.","messagePattern":"Local voice transcription dependencies are missing\\. Install the `media` extra and ensure ffmpeg is on PATH\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"libs/talon/deepagents_talon/speech.py","lineNumber":253,"sourceCode":"                wav_path.unlink(missing_ok=True)\n            except OSError:\n                logger.debug(\"Could not delete temporary voice transcription file: %s\", wav_path)\n\n\ndef _load_local_pipeline(model: str, device: str) -> _LocalSpeechPipeline:\n    key = (model, device)\n    cached = _local_pipelines.get(key)\n    if cached is not None:\n        return cached\n\n    try:\n        module = importlib.import_module(\"transformers\")\n    except ImportError as exc:\n        msg = (\n            \"Local voice transcription dependencies are missing. Install the `media` \"\n            \"extra and ensure ffmpeg is on PATH.\"\n        )\n        raise ImportError(msg) from exc\n\n    logger.info(\"Loading local voice transcription model %s on device=%s\", model, device)\n    loaded = module.pipeline(\n        \"automatic-speech-recognition\",\n        model=model,\n        device=device,\n    )\n    _local_pipelines[key] = loaded\n    logger.info(\"Local voice transcription model %s ready on device=%s\", model, device)\n    return loaded\n\n\ndef _pipeline_text(result: object) -> str:\n    if isinstance(result, Mapping):\n        values = cast(\"Mapping[str, object]\", result)\n        text = values.get(\"text\")\n        return text.strip() if isinstance(text, str) else \"\"\n    text = getattr(result, \"text\", None)","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/talon/deepagents_talon/speech.py#L235-L271","documentation":"Local voice transcription uses Hugging Face `transformers` (loaded lazily via importlib) to build an automatic-speech-recognition pipeline. If `transformers` is not installed, `_load_local_pipeline` raises this ImportError pointing to the `media` extra and ffmpeg. It is a deliberate, explanatory error for an optional dependency set.","triggerScenarios":"Requesting local (non-API) transcription of an audio file when the `transformers` package (part of the `media` extra) is absent from the environment.","commonSituations":"Installing talon without `pip install deepagents-talon[media]`; running in a slim Docker image that trimmed ML dependencies; switching from a cloud transcription backend to local transcription in a fresh venv.","solutions":["Install the extra: `pip install \"deepagents-talon[media]\"` (or `uv sync --extra media`)","Verify with `python -c \"import transformers\"` that the import works in the target environment","Alternatively configure a cloud/API transcription backend that does not need the local pipeline"],"exampleFix":"# before\npip install deepagents-talon\n# after\npip install \"deepagents-talon[media]\"","handlingStrategy":"fallback","validationCode":"import importlib.util\nif importlib.util.find_spec(\"transformers\") is None:\n    raise SystemExit(\"Install the media extra: pip install 'deepagents-talon[media]'\")","typeGuard":null,"tryCatchPattern":"try:\n    text = transcribe_local(path)\nexcept ImportError as exc:\n    if \"media\" in str(exc):\n        text = transcribe_cloud(path)  # fallback backend\n    else:\n        raise","preventionTips":["Always install the `media` extra in environments that do local transcription","Add a CI check importing transformers in the deployment image","Document the extra in setup scripts and Dockerfiles"],"tags":["dependencies","import","voice","install"],"backgroundTag":"missing-optional-dependency","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}