> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# Speech helpers

> Functions that turn digits and amounts into the words a voice should say, and read what a caller spelled out.

[add-pronunciation]: /docs/server-sdks/reference/python/agents/agent-base/add-pronunciation

[say]: /docs/server-sdks/reference/python/agents/function-result/say

The `signalwire.speech` module gives the words a voice should say for digits and
amounts, and `signalwire.speech.spelling` reads letters, digits, and email addresses
a caller spelled out. All of them work on English text.

The platform normalizes text before its pronunciation rules run, so a bare number
is already words by then: [`add_pronunciation()`][add-pronunciation] can't make
`"10001"` read digit by digit. Put the words these functions return in a
[`say`][say] action, or in the tool result the model reads back.

```python
from signalwire.speech import say_digits, say_last_digits, say_money, number_words
from signalwire.speech.spelling import read_spelled, spoken_email, spelling_variants
```

## Numbers

#### [say_digits](/docs/server-sdks/reference/python/agents/speech/say-digits)

The digits in a string, one word each, in groups.

#### [say_last_digits](/docs/server-sdks/reference/python/agents/speech/say-last-digits)

The last digits of a number, one word each.

#### [say_money](/docs/server-sdks/reference/python/agents/speech/say-money)

An amount of money in words.

#### [number_words](/docs/server-sdks/reference/python/agents/speech/number-words)

A whole number in English words.

## Spelled input

#### [read_spelled](/docs/server-sdks/reference/python/agents/speech/read-spelled)

The letters, digits, and symbols a caller spelled.

#### [spoken_email](/docs/server-sdks/reference/python/agents/speech/spoken-email)

An email address said aloud, as text.

#### [spelling_variants](/docs/server-sdks/reference/python/agents/speech/spelling-variants)

The spellings a word could be, given letters the recognizer confuses.

## Example

A tool that reads an account number back digit by digit:

```python {7}
from signalwire import AgentBase, FunctionResult
from signalwire.speech import say_digits

agent = AgentBase(name="billing", route="/billing")

def read_account(args, raw_data):
    words = say_digits(args["account"], group=4)
    return FunctionResult("Read the account number back.").say(
        f"Your account number is {words}."
    )

agent.define_tool(
    "read_account", "Read the caller's account number back",
    {"type": "object", "properties": {"account": {"type": "string"}}, "required": ["account"]},
    read_account,
)
```