Skip to content

DictationConfig has no llm field: documented custom LLM request / aai_prompt unreachable #299

Open

Description

@YashasviThakur

Docs ("Transcript rewriting → Sending your own LLM request") say config.llm accepts an LLM Gateway request: messages/prompt with {{turn}}, model, max_tokens, temperature, response_format, reasoning_effort, or a saved prompt via aai_prompt + prompt_replacements.

The API accepts it. Verified against dictation.assemblyai.com/v1/transcribe/live: {"llm":{"messages":[...]}} returns 200 with a rewrite, and llm + llm_instruction returns 400 "set either llm_instruction or llm, not both".

This SDK cannot send it. DictationConfig (assemblyai/dictation/v1/models.py, 1.10.12) has no llm field and sets extra="forbid", so DictationConfig(llm={...}) raises a validation error. There is no way to send the field.

Impact: saved prompts (aai_prompt), model choice, max_tokens, temperature and response_format are only usable by hand-rolling multipart, even though the docs steer people to the SDK.

Suggested fix: add an llm field typed to the documented set, enforce mutual exclusion with llm_instruction. The Node SDK has the same gap (buildConfigJson drops unknown fields).

Activity

  1. YashasviThakur commented on Nov 19, 2026

    @YashasviThakur
    Author

    Adding context from the "Authenticate your app" docs page: it tells apps that run on users' devices to keep rewrite prompts off the device by saving them in the account and sending only {"llm": {"aai_prompt": "my-app-cleanup", "prompt_replacements": {...}}} in the dictation config. That flow is impossible through this SDK (and the other one), so the SDKs cannot follow the docs' own security recommendation for the audience (web, desktop, mobile) the page is written for. Raising the priority of this one.

  2. mayankbohradev commented on Nov 27, 2026

    @mayankbohradev
    Contributor

    I'd like to work on this. I'll add an llm field to DictationConfig with the fields the docs list, and check the documented rules before the request is sent (llm or llm_instruction, not both; the 8192 token caps; aai_prompt only with prompt_replacements). I'll open a PR soon.

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