currency

Expand currency amounts into spoken form for TTS.

async pipecat.utils.text.transforms.currency.expand_currency(text: str, aggregation_type: str | AggregationType) str[source]

Expand currency amounts to their spoken form.

Parameters:
  • text – Input text possibly containing currency expressions.

  • aggregation_type – Aggregation type of the text frame (unused).

Returns:

Text with currency amounts replaced by spoken equivalents.

Example:

result = await expand_currency("Your balance is $42.50", "*")
# "Your balance is forty-two dollars and fifty cents"