# Agent.handle\_text(msg) always returns 'None'

**URL:** <https://forum.rasa.com/t/agent-handle-text-msg-always-returns-none/12507>\
**Category:** Rasa Open Source\
**Created:** [July 4, 2019, 4:27pm UTC](https://forum.rasa.com/t/agent-handle-text-msg-always-returns-none/12507 "2019-07-04T16:27:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cayetano](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@cayetano](https://forum.rasa.com/u/cayetano)\
**Post date:** [July 4, 2019, 4:27pm UTC](https://forum.rasa.com/t/agent-handle-text-msg-always-returns-none/12507/1 "2019-07-04T16:27:03Z")

</div>

Hello,

Could anybody explain why this code returns always ‘None’? This is a minimum code done after creating and training a new project that works in the command line. Thank you!

```
import asyncio
from rasa.core.agent import Agent
from rasa.core.interpreter import RasaNLUInterpreter

async def process(msg):
    agent = Agent.load("models")
    output = await agent.handle_text(msg)
    print(output)
    return output

asyncio.run(process("hi"))
```

---

<div class="post-metadata">

**Author:** ![Tobias\_Wochinger](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tobias_wochinger/32/4580_2.png) [@Tobias\_Wochinger](https://forum.rasa.com/u/Tobias_Wochinger)\
**Post date:** [July 5, 2019, 1:41pm UTC](https://forum.rasa.com/t/agent-handle-text-msg-always-returns-none/12507/2 "2019-07-05T13:41:34Z")

</div>

Good question 😆 Do you have any logs? Is there already a trained model? I think `"model"` should be the complete path to the model archive.

One more question: Why not using the CLI, but rather custom Python code? Maybe our API could also help you out here [https://rasa.com/docs/rasa/api/jupyter-notebooks/](https://rasa.com/docs/rasa/api/jupyter-notebooks/)
