Getting Custom JSON response from agent.handle_text

Hi,

when I am calling agent.handle_text(message,sender_id), it currently returns a list of dictionaries rather than one single dictionary. In greater detail, the message will invoke a custom action which in the end calls CollectingDispatcher.utter_message(text=‘some text’, json_message=‘json message’).

Right now it returns something like: [ {‘sender_id’: xxx, ‘text’:…}, {‘sender_id’:xxx, ‘custom’:…} ]

May I know if there is a way to return only: {‘sender_id’: xxx, ‘text’:…, ‘custom’:…}

Thanks!

In other words, I want to condense everything into one single JSON object