Skip to content

SDK blocking path: speech_model in options causes AssemblyAI 400 #23

Description

@Lazare-42

Bug

Related to #21 (now fixed in schema). The blocking batch path (router.transcribe()) still fails when user-provided options contain speech_model (singular, deprecated).

Scenario

Bots created with SDK < 0.8.5 have transcription_custom_params: { "speech_model": "universal" } stored in the database. When retranscribing these bots, the stored params are passed to router.transcribe(). The SDK forwards speech_model to AssemblyAI, which responds:

Invalid endpoint schema, please refer to documentation for examples. — HTTP 400

Root cause

The SDK's internal AssemblyAI adapter in router.transcribe() doesn't map/strip the deprecated speech_model key. Since v0.8.5 removed speech_model from AssemblyAITranscriptionSchema, new bots won't have it — but existing bots with stored params still do.

Expected behavior

The SDK should either:

  1. Map speech_modelspeech_models: [value] internally (backwards compat), or
  2. Strip speech_model and log a deprecation warning

Workaround

We're mapping speech_modelspeech_models in our wrapper before calling router.transcribe():

if (provider === "assemblyai" && "speech_model" in unflattened) {
  if (!("speech_models" in unflattened)) {
    unflattened["speech_models"] = [unflattened["speech_model"]]
  }
  delete unflattened["speech_model"]
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions