Repository navigation
Conversation
KeyTerms borrowed 2048 — the cap llm_instruction carried at the time — for a field the reference documents at 8000 characters in all four of its tellings, and which the first-party SDKs enforce client-side at the same value. Lists between the two were silently truncated: terms the user typed were dropped from boosting though the API would accept them. The byte counting stays — the documented unit is characters, unmeasured, and bytes can only overestimate. Closes AssemblyAI#453
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Fixes #453.
KeyTerms.characterCapwas 2048, documented in-code as "the cap the API places onconfig.keyterms_prompt". The reference says 8000 characters in all four of its tellings (the/v1/transcribe/livereference, the prompting-and-keyterms guide, the quickstart, the buffered/v1/transcribe),termCap's own docstring ten lines below already quoted the correct figure back, and the first-party SDKs enforce the limit client-side at the same value —maxKeytermsPromptLength = 8000in bothservices/dictationandservices/syncofassemblyai-node-sdk. The repo's own history says where 2048 came from: it was the capllm_instructioncarried at the time (StyleProfileStore.swift,CleanupInstruction.swift), reused for the wrong field — exactly the failure mode the docstring warns about forstt_prompt.The cost was silent vocabulary loss: a key term list between 2048 bytes and the documented cap was truncated by
KeyTerms.fitted— terms the user typed dropped from boosting, no feedback anywhere — though the API would have accepted them.The change is the number alone. The byte counting stays as it was: the documented unit is "characters", unmeasured against the endpoint for this field, and bytes can only overestimate a multi-byte term's cost, so the fitted list can never 400 the request. If a measurement ever shows the endpoint counts scalars the way
stt_promptdoes, the conservative reading can be revisited on evidence rather than inference.How it was tested
The pinned-value test in
KeyTermsTestsnow pins 8000; the rest of that suite (fit-to-cap, whole-terms, term-cap independence, inclusive boundary) is value-independent and exercises the new figure.scripts/check.sh --portablegreen end-to-end on this Linux host;swift-format lint --strictclean on every touched file. CI on macos-26 is the authority on the Swift build and test run.scripts/check.shpasses (or CI will, if I'm not on a Mac)I read AGENTS.md and this doesn't reintroduce anything deliberately removed
Docs updated if behavior changed