How to set a response as first message

Hi all,
I would like to know which is the simplest way to set a response as chatbot’s first message.
I have tried with:

 rules:
 - rule: top bot description
   conversation_start: true 
   wait_for_user_input: false
   steps:
   - action: utter_start

but it doesn’t work.

Hi @SimoCanc

To have the assistant start the conversation, you can use the action_session_start action.

1 Like

As suggested, I have tried:

class ActionSessionStart(Action): 
  	def name(self) -> Text:
  	    return "action_session_start"

  	def run(self,
  	        dispatcher: CollectingDispatcher,
  	        tracker: Tracker,
  	        domain: Dict[Text, Any]):

  		events = [SessionStarted()]

  		say_hello = "Say hello to Xyz, our chatbot"	
  		dispatcher.utter_message(say_hello)

  		return events

When I run the aforementioned code, I get this error:

[2579] [ERROR] Exception occurred while handling uri: 'http://localhost:5005/conversations/c9c1cb27c0c2492785ada7527fb254bf/tracker?include_events=ALL

AttributeError: 'NoneType' object has no attribute 'send_response'

If needed, I can post the entire (very long) error’s log

Sorry @SimoCanc, this looks like this bug: Api call at /conversation/{conv-id}/tracker fails when custom action_session_start generates some messages · Issue #7248 · RasaHQ/rasa · GitHub What’s the output of rasa --version for you?

Rasa Version     : 2.4.3
Rasa SDK Version : 2.4.1
Rasa X Version   : None
Python Version   : 3.6.12
Operating System : Linux-5.4.0-70-generic-x86_64-with-debian-bullseye-sid
1 Like