Yes, I was looking at the source code too, hoping to find where the line breaks are being lost, but couldn’t find it.
Funny thing is that in online training mode the line breaks are there.
Unfortunately I don’t have a fully reproducable example, but basically I subclass the DialogueStateTracker and then use the current_state() method to pick up all earlier events and from there I pick up all the bot-events and their texts:
events = self.current_state(should_include_events=True)['events']
# create a list of all 'bot' events from the end of the events, but only
# the ones after the last 'user' event, or if there was no such (eg first bot message)
latest_bot_utterances = 
for e in reversed(events):
# if this is the bot's message, then it gets added to the list
# (but only with its 'text' and 'data' attributes)
if e['event'] == 'bot':
# if we hit a user event, then we exit
if e['event'] == 'user':
# we need to reverse the list, so its messages are returned in their chronological order
By the time I pick up the ‘text’ attributes from the events, the line breaks are already missing.