rasa/core/server.py
async def tracker_predict(request: Request):
        """ Given a list of events, predicts the next action"""

        sender_id = UserMessage.DEFAULT_SENDER_ID
        request_params = request.json
        verbosity = event_verbosity_parameter(request,
                                              EventVerbosity.AFTER_RESTART)

        try:
            tracker = DialogueStateTracker.from_dict(sender_id,
                                                     request_params,
                                                     app.agent.domain.slots)
        except Exception as e:
            raise ErrorResponse(400, "InvalidParameter",
                                "Supplied events are not valid. {}".format(e),
                                {"parameter": "", "in": "body"})

        policy_ensemble = app.agent.policy_ensemble
        probabilities, policy = \
            policy_ensemble.probabilities_using_best_policy(tracker,
                                                            app.agent.domain)

        scores = [
            {"action": a, "score": p}
            for a, p in zip(app.agent.domain.action_names, probabilities)
        ]

        return response.json({
            "scores": scores,
            "policy": policy,
            "tracker": tracker.current_state(verbosity)
        })
 Given a list of events, predicts the next action
Given a list of events, predicts the next action
Given a list of events predicts the next action
async def tracker_predict(request: Request):
        sender_id = UserMessage.DEFAULT_SENDER_ID
        request_params = request.json
        verbosity = event_verbosity_parameter(request,
                                              EventVerbosity.AFTER_RESTART)
        try:
            tracker = DialogueStateTracker.from_dict(sender_id,
                                                     request_params,
                                                     app.agent.domain.slots)
        except Exception as e:
            raise ErrorResponse(400, "InvalidParameter",
                                "Supplied events are not valid. {}".format(e),
                                {"parameter": "", "in": "body"})
        policy_ensemble = app.agent.policy_ensemble
        probabilities, policy = \
            policy_ensemble.probabilities_using_best_policy(tracker,
                                                            app.agent.domain)
        scores = [
            {"action": a, "score": p}
            for a, p in zip(app.agent.domain.action_names, probabilities)
        ]
        return response.json({
            "scores": scores,
            "policy": policy,
            "tracker": tracker.current_state(verbosity)
        })
async def tracker_predict ( request : Request ) : sender_id = UserMessage . DEFAULT_SENDER_ID request_params = request . json verbosity = event_verbosity_parameter ( request , EventVerbosity . AFTER_RESTART ) try : tracker = DialogueStateTracker . from_dict ( sender_id , request_params , app . agent . domain . slots ) except Exception as e : raise ErrorResponse ( 400 , "InvalidParameter" , "Supplied events are not valid. {}" . format ( e ) , { "parameter" : "" , "in" : "body" } ) policy_ensemble = app . agent . policy_ensemble probabilities , policy = policy_ensemble . probabilities_using_best_policy ( tracker , app . agent . domain ) scores = [ { "action" : a , "score" : p } for a , p in zip ( app . agent . domain . action_names , probabilities ) ] return response . json ( { "scores" : scores , "policy" : policy , "tracker" : tracker . current_state ( verbosity ) } )
Given a list of events, predicts the next action
Given a list of events predicts the next action
""" Given a list of events, predicts the next action"""
request
Request