***

title: simulate_user_input
slug: /reference/python/agents/function-result/simulate-user-input
description: Inject text as simulated user speech input.
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

Inject text as if the user spoke it. The AI agent processes the injected text
exactly as it would process real speech input. Useful for driving automated
workflows or confirmations.

## **Parameters**

<ParamField path="text" type="str" required={true} toc={true}>
  Text to inject as simulated user speech.
</ParamField>

## **Returns**

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

## **Example**

```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="auto_confirm", description="Automatically confirm the action")
def auto_confirm(args, raw_data):
    return (
        FunctionResult()
        .simulate_user_input("yes, I confirm")
    )

agent.serve()
```