How to pass extra parameters in in handle_text in rasa?

you could create a boolean slot for customer and predict different utter template

But how can I pass that slot in agent.handle_text(msg, sender_id=data["user_id"]) to be used in action_class ?

If I’m not wrong I need to set it somewhere as I am not setting it in ActionClass. I am recieving it through request made on Flask web service.

you don’t need to pass to handle_text method if you use slots functionality of rasa: Slots

Sorry but I am not still clear with this because I am not recieving customer value in data['message']. I am receiving it in data['customer']. In this case how can I set slot? One thing I am sure I can’t set it in stories. So I am looking for if I can access this in ActionClass

please take a look at the docs: Actions, you can set a slot in custom action by returning appropriate event

I don’t want to set inside the ActionClass. I already know if customer value is 0 or 1 from the request that I recieved. I just want to access it inside the Action Class

there is an example how to get value of slot cuisine in the code snippet in the docs. And there is a description on how to use parameters: Actions

I checked that example but the cuisine slot was set using entity which is acquired from text itself. eg. show me a Mexican restaurant

In this value of cuisine is set to Mexican. I think this is not what I need as I recieved value of customer in different key not from text.

regardless how you set it, if the information is stored as a slot in the tracker, you can get it from the tracker using tracker.get_skot(...) method

I believe what Akshay is asking for is

  "message": "what is refund policy"
  "customer": 1

How can we make RASA to accept an additional input parameter ‘customer’? I also need the same functionality.

My functionality is to know whether the customer is a admin or employee.

So, I need my bot to accept the parameters:

      "message": "what is refund policy"
      "customer": "admin" || "employee" 

Should we be editing the input channel ? Also Please help me out with this post:

1 Like

my suggestion is to add one more event to set a corresponding slot in rasa

we’re answering all forum posts as fast as we can, please wait for the answer for your other post

yes @suryavamsi62 This is exactly what I am trying to implement.

Hi @sociopath00, @suryavamsi62, please have a look at the docs on adding metadata information to user messages: Custom Connectors. I hope that helps!

1 Like

Thanks ricwo. Got the idea and implemented the meta data in custom input channel.

Okay. Just out of curiosity asked about the other post.

Can you help me out here? I am struggling to implement custom connector

@sociopath00, please also check out the related topic Link up Custom input Channel with a custom Output Channel, where we go into some details of the implementation. I hope that helps!

Hi @Ghostvv, i want to send extra values to rasa using webhooks from web page, using ajax. how can I achieve this. i added another key values but not working.

for example JSON.stringify({ message: message, sender: user_id })

JSON.stringify({ message: message, sender: user_id, project_id: 23 })

Hello how are you, I think we want to do similar things, I share some threads where I was asking