rasa/core/server.py
async def append_event(request: Request, sender_id: Text):
        """Append a list of events to the state of a conversation"""

        request_params = request.json
        evt = Event.from_parameters(request_params)
        tracker = app.agent.tracker_store.get_or_create_tracker(sender_id)
        verbosity = event_verbosity_parameter(request,
                                              EventVerbosity.AFTER_RESTART)

        if evt:
            tracker.update(evt)
            app.agent.tracker_store.save(tracker)
            return response.json(tracker.current_state(verbosity))
        else:
            logger.warning(
                "Append event called, but could not extract a "
                "valid event. Request JSON: {}".format(request_params))
            raise ErrorResponse(400, "InvalidParameter",
                                "Couldn't extract a proper event from the "
                                "request body.",
                                {"parameter": "", "in": "body"})
Append a list of events to the state of a conversation
Append a list of events to the state of a conversation
Append a list of events to the state of a conversation
async def append_event(request: Request, sender_id: Text):
        request_params = request.json
        evt = Event.from_parameters(request_params)
        tracker = app.agent.tracker_store.get_or_create_tracker(sender_id)
        verbosity = event_verbosity_parameter(request,
                                              EventVerbosity.AFTER_RESTART)
        if evt:
            tracker.update(evt)
            app.agent.tracker_store.save(tracker)
            return response.json(tracker.current_state(verbosity))
        else:
            logger.warning(
                "Append event called, but could not extract a "
                "valid event. Request JSON: {}".format(request_params))
            raise ErrorResponse(400, "InvalidParameter",
                                "Couldn't extract a proper event from the "
                                "request body.",
                                {"parameter": "", "in": "body"})
async def append_event ( request : Request , sender_id : Text ) : request_params = request . json evt = Event . from_parameters ( request_params ) tracker = app . agent . tracker_store . get_or_create_tracker ( sender_id ) verbosity = event_verbosity_parameter ( request , EventVerbosity . AFTER_RESTART ) if evt : tracker . update ( evt ) app . agent . tracker_store . save ( tracker ) return response . json ( tracker . current_state ( verbosity ) ) else : logger . warning ( "Append event called, but could not extract a " "valid event. Request JSON: {}" . format ( request_params ) ) raise ErrorResponse ( 400 , "InvalidParameter" , "Couldn't extract a proper event from the " "request body." , { "parameter" : "" , "in" : "body" } )
Append a list of events to the state of a conversation
Append a list of events to the state of a conversation
"""Append a list of events to the state of a conversation"""
request
Request
sender_id
Text