Search code examples
pythonpython-3.6rasa-nlurasa-core

Rasa Core: utter_template() missing 1 required positional argument: 'tracker'


I am using Rasa core v10.2, with custom actions, but getting utter_template() missing 1 required positional argument: 'tracker' error on the run function.

Custom action file: (actions.py)

from rasa_core.actions import Action
from rasa_core.events import SlotSet

class searchJob(Action):
    def name(self):
        return 'action_search'

    def run(self, dispatcher, tracker, domain):
        return [SlotSet("jobsname", "as_aggregate")]

domain.yml:

slots:
  jobsname:
    type: text

templates:
 utter_answer:
    - text: "The required jobs are {jobsname}"

Stories:

* search
  - action_search
  - utter_answer

The output is [{'recipient_id': 'default', 'text': 'The required jobs are None'}] which means the Slot it not set. Could the error message be the cause of it?

Thank you.


Solution

  • So the issue seems to be the name of the custom action file, change it to anything else from 'actions' will do.