Skip to content

Conversation

@dan-ince-aai
Copy link
Contributor

Hi team!

Added dynamic keyterms updating without closing the stream, sends a message with type "UpdateConfiguration" https://www.assemblyai.com/docs/api-reference/streaming-api/streaming-api#send.sendUpdateConfiguration

Language code is returned when "Language_detection" is True (set now by default), and we pass this in the preflight and final transcripts, its only returned with utterances so we store it when we get it
https://www.assemblyai.com/docs/api-reference/streaming-api/streaming-api#receive.receiveTurn.language_code

Also normalized the preemptive generation text in agent_activity before validation, so we only compare if there are new words and not any changes in casing or punctuation.


# Normalize text by lowercasing and removing punctuation for comparison
def normalize_text(text: str) -> str:
return text.lower().translate(str.maketrans("", "", string.punctuation))
Copy link
Contributor

Choose a reason for hiding this comment

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

should we just use text.strip() to remove start and end spaces, different punctuation like ? or ! may have different TTS results?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@longcw in my testing, the same input to an LLM but changing between blank, ?, ! has no effect on the LLM response

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO we shouldn't normalize the punctuations in the agents framework, maybe you can add it to the specific (validated) STT to reuse the latest transcript sent to the preemptive generation as the final version if the normalized text is the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks @longcw!

Let me know if there's anything else needed for this PR or all good to go

@dan-ince-aai
Copy link
Contributor Author

Hi @longcw @theomonnom may we have this updated PR reviewed?

The type checks and tests are failing due to OpenAI plugin

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.

2 participants