0

agent.handle_message("hi") gives me a None result in my code. I loaded interpreter correctly.

When i run interpreter.parse("my_message"), it gives me correct result.

Dushan
  • 1,365
  • 20
  • 26
  • Hi @Dunshan, How did you initialise your agent? Did you train or load a model with it? Sounds like it may be missing a domain or policy ensemble. – Tom Metcalfe Aug 03 '19 at 22:27
  • @TomMetcalfe i trained my model using `rasa train`. What may be the problem? – Dushan Aug 05 '19 at 09:12
  • 1
    In that case you don't need to pass an interpreter. If you used `rasa train` without the `nlu` or `core` mode then the full stacked model will be saved as a `.tar.gz` in the `models` directory. Load that with `agent = Agent.load('path/to/model.tar.gz')` and then you can handle text with `asyncio.run(agent.handle_text("hello"))` (or `await agent.handle_text("hello")` if it's inside a function). Here's the [docs page on agents](https://rasa.com/docs/rasa/api/agent/#rasa.core.agent.Agent.handle_text) – Tom Metcalfe Aug 09 '19 at 09:59

0 Answers0