Module livekit.agents.tokenize.utils

Functions

def replace_words(*, text: str | AsyncIterable[str], replacements: dict[str, str]) ‑> Union[str, AsyncIterable[str]]

Replace words in the given (async) text. The replacements are case-insensitive and the replacement will keep the case of the original word.

Args

text
text to replace words in
words
dictionary of words to replace