rasa/core/tracker_store.py
def save(self, tracker: DialogueStateTracker) -> None:
        """Update database with events from the current conversation."""

        if self.event_broker:
            self.stream_events(tracker)

        events = self._additional_events(tracker)  # only store recent events

        for event in events:

            data = event.as_dict()

            intent = data.get("parse_data", {}).get("intent", {}).get("name")
            action = data.get("name")
            timestamp = data.get("timestamp")

            # noinspection PyArgumentList
            self.session.add(self.SQLEvent(sender_id=tracker.sender_id,
                                           type_name=event.type_name,
                                           timestamp=timestamp,
                                           intent_name=intent,
                                           action_name=action,
                                           data=json.dumps(data)))
        self.session.commit()

        logger.debug("Tracker with sender_id '{}' "
                     "stored to database".format(tracker.sender_id))
Update database with events from the current conversation.
Update database with events from the current conversation.
Update database with events from the current conversation .
def save(self, tracker: DialogueStateTracker) -> None:
        if self.event_broker:
            self.stream_events(tracker)
        events = self._additional_events(tracker)  
        for event in events:
            data = event.as_dict()
            intent = data.get("parse_data", {}).get("intent", {}).get("name")
            action = data.get("name")
            timestamp = data.get("timestamp")
            self.session.add(self.SQLEvent(sender_id=tracker.sender_id,
                                           type_name=event.type_name,
                                           timestamp=timestamp,
                                           intent_name=intent,
                                           action_name=action,
                                           data=json.dumps(data)))
        self.session.commit()
        logger.debug("Tracker with sender_id '{}' "
                     "stored to database".format(tracker.sender_id))
def save ( self , tracker : DialogueStateTracker ) -> None : if self . event_broker : self . stream_events ( tracker ) events = self . _additional_events ( tracker ) for event in events : data = event . as_dict ( ) intent = data . get ( "parse_data" , { } ) . get ( "intent" , { } ) . get ( "name" ) action = data . get ( "name" ) timestamp = data . get ( "timestamp" ) self . session . add ( self . SQLEvent ( sender_id = tracker . sender_id , type_name = event . type_name , timestamp = timestamp , intent_name = intent , action_name = action , data = json . dumps ( data ) ) ) self . session . commit ( ) logger . debug ( "Tracker with sender_id '{}' " "stored to database" . format ( tracker . sender_id ) )
Update database with events from the current conversation.
Update database with events from the current conversation .
"""Update database with events from the current conversation.""" # only store recent events # noinspection PyArgumentList
self
tracker
DialogueStateTracker