***

title: add_dynamic_hints
slug: /reference/python/agents/function-result/add-dynamic-hints
description: Add speech recognition hints dynamically during a call.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

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

Add speech recognition hints dynamically during a call. Hints improve recognition
accuracy for domain-specific vocabulary, product names, or uncommon words. Each
hint can be a simple string or a pronunciation pattern object that maps
misrecognized speech to the correct text.

## **Parameters**

<ParamField path="hints" type="list[str | dict[str, Any]]" required={true} toc={true}>
  List of hints. Each entry is either:

  * A `str` — a word or phrase to boost recognition (e.g., `"SignalWire"`)
  * A `dict` with pronunciation pattern fields:

  | Field         | Type   | Description                                 |
  | ------------- | ------ | ------------------------------------------- |
  | `pattern`     | `str`  | Regex pattern to match in recognized speech |
  | `replace`     | `str`  | Replacement text when the pattern matches   |
  | `ignore_case` | `bool` | Case-insensitive matching (optional)        |
</ParamField>

## **Returns**

[`FunctionResult`][functionresult] — self, for chaining.

## **Examples**

### Simple Word Hints

```python {11}
from signalwire import AgentBase
from signalwire import FunctionResult

agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(name="set_medical_context", description="Add medical speech hints")
def set_medical_context(args, raw_data):
    return (
        FunctionResult("Switching to medical context.")
        .add_dynamic_hints(["prescription", "dosage", "milligrams", "refill"])
    )

agent.serve()
```

### Pronunciation Patterns

```python {12}
from signalwire import AgentBase
from signalwire import FunctionResult

agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(name="set_name_hints", description="Add name pronunciation hints")
def set_name_hints(args, raw_data):
    name = args.get("customer_name", "")
    return (
        FunctionResult(f"I'll listen for {name}.")
        .add_dynamic_hints([
            name,
            {"pattern": "cab bee", "replace": "Cabby", "ignore_case": True}
        ])
    )

agent.serve()
```