Hello,
I am new to rasa (using Botfront)
and I have troubles using the value of a slot in Botfront custom channel
from more clarification
in Botfront rest API request looks like this:
so I need the “language” key to be set from a slot
so I made custom channel based on Botfront rest API and implement the get_metadata function
to get last value for the slot for the user
need something like that:
class MyRestInput(BotfrontRestInput):
def get_metadata(self, request: Request) -> Optional[Dict[Text, Any]]:
language = tracker.get_slot("language","en")
return {'language': language}
The botfront rasa-webchat uses sockets not REST. Why are are you using a custom REST channel instead of socket channel?
I need the “language” key to be set from a slot
customData.language is sent from the chat widget to Rasa. customData.language is not a slot, it is an object provide on the socket channel so you can’t call tracker.get_slot for this value.
Hello @stephens
I’m using rasa rest API as web hock in the begging of the story I’m asking the user for the preferred language then save the selected language in a slot
now when ever I have this sender id in the rest API I want to check the user history and get the last value of the language Slot to reply with it