Hello rasa fans!
I have a customized channel that works like the callback channel . I needed to customize it so I could pass metadata to rasa in the Input. I would like that metadata to be in my responses as well. Is it possible?
This is my current outputchannel to post response in another endpoint:
class MychannelOutput(CollectingOutputChannel):
@classmethod
def name(cls) -> Text:
return "mychannel"
def __init__(self, endpoint: EndpointConfig) -> None:
self.mychannel_endpoint = endpoint
super().__init__()
async def _persist_message(self, message: Dict[Text, Any]) -> None:
await super()._persist_message(message)
try:
await self.mychannel_endpoint.request(
"post", content_type="application/json", json=message, verify_ssl=False
)
except ClientResponseError as e:
logger.error(
"Failed to send output message to mychannel. "
"Status: {} Response: {}"
"".format(e.status, e.text)
)
RESUME In summary I would like post for example (it’s ok actually):
{
"sender": "test_user",
"message": "Hi!",
"metadata": {
"idMessage": "026357c9-7279-4ddb-887f-56e6560fd56c"
}
}
and the answer to my endpoint would be (missing metadata actually) …
{
"recipient_id": "test_user",
"text": "Hi 👋 \ n I am virtual assistant 🤖."
"metadata": {
"idMessage": "026357c9-7279-4ddb-887f-56e6560fd56c"
}
}