Skip to content

Conversation

dan-ince-aai
Copy link
Contributor

added utterance as a preflight transcript as per @longcw guidance, docs: https://www.assemblyai.com/docs/api-reference/streaming-api/streaming-api#receive.receiveTurn.utterance

the utterance is emitted if a short pause is detected and all words have been finalised, so that it can be used for preemptive generation

one issue I did notice though is that the preemptive generation validation is an absolute comparison so even though no words have changed, if the final transcript includes an extra comma it cancels, is this intended or could it be edited to first lowercase the text and strip punc and compare just words?

@theomonnom
Copy link
Member

theomonnom commented Oct 15, 2025

lgtm! can you fix the type checks?

one issue I did notice though is that the preemptive generation validation is an absolute comparison so even though no words have changed, if the final transcript includes an extra comma it cancels, is this intended or could it be edited to first lowercase the text and strip punc and compare just words?

fair point, I think we can do this change, do you want to contribute it?

@dan-ince-aai
Copy link
Contributor Author

Done, thanks @theomonnom!

I also added speech_model to support the multilingual model which is now in prod, the docs unfortunately haven't been updated yet to display the speech_model param instead of language but this was deployed to prod yesterday: https://www.assemblyai.com/docs/universal-streaming/multilingual-transcription

Will contribute the preemptive validation change in a separate PR

buffer_size_seconds: float
encoding: str = "pcm_s16le"
encoding: Literal["pcm_s16le", "pcm_mulaw"] = "pcm_s16le"
speech_model: Literal["universal-streaming-english", "universal-streaming-multilingual"] = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you update this to model to be consistent? speech is redundant since this is an STT module

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants