Redis tracker store problem

Well, that depends what format works best for your customer rep, but you’d probably have to write a method to take the tracker and print (or write to a file) the user/bot utterances line by line, in its simplest form that would be something like:

for event in tracker.events:
    if isinstance(event, UserUttered):
        print(f"user: {event.text}")
    elif isinstance(event, BotUttered):
       print(f"bot: {event.text}")

If the customer rep cares about which action was executed, what entities were picked up or slots were set, you’ll have to extend that code.

Not sure what you mean by “Rasa X as a widget”. Rasa X is its own tool for viewing conversations and utterances. You can read more about how to deploy it here

Thank you so much but can you give me the full code for this in action.py

I’m sorry, I can only help you with specific questions – I can’t write an entire actions.py file for you.

1 Like

I understand

1 Like

I have saved the conversations in sqlite but could you tell me a way to view it in a simple format like what the bot said and what the user said instead of all the other unnecessary things

Does the above code not work for you? If not, what problems are you having?

You’ll need to step through the events of each tracker and only print out or display the ones that are either of type UserUttered or BotUttered

It is working but the problem is I am not getting the data in the format I want rather I have to search in the heap of data it is showing

I meant, is this not working?

    for event in tracker.events:
        if isinstance(event, UserUttered):
            print(f"user: {event.text}")
        elif isinstance(event, BotUttered):
           print(f"bot: {event.text}")

You’ll have to sift through the heap of data in some way, we have no endpoint for producing a simplified tracker. You could do the above if you want to print, or you could put it into a new data structure if that works better for you, for example something like this:

simplified_tracker = []
USER = "user"
BOT = "bot"
for event in tracker.events:
     if isinstance(event, UserUttered):
         simplified_tracker(f"{USER}: {event.text}")
     elif isinstance(event, BotUttered):
         print(f"{BOT}: {event.text}")
1 Like

I really can’t understand where should I put this code in actions.py or in any other because I am a beginner

And should it be from tracker.events or the name of the file like xyz.db

Where you put the code depends on what you’re trying to do! You said above that it’s working but not in the right format. Is this when you’re reading the .db file?Can you share with me the output you’re seeing and the output you want?