rasa/core/training/interactive.py
async def send_action(
    endpoint: EndpointConfig,
    sender_id: Text,
    action_name: Text,
    policy: Optional[Text] = None,
    confidence: Optional[float] = None,
    is_new_action: bool = False
) -> Dict[Text, Any]:
    """Log an action to a conversation."""

    payload = ActionExecuted(action_name, policy, confidence).as_dict()

    subpath = "/conversations/{}/execute".format(sender_id)

    try:
        return await endpoint.request(json=payload,
                                      method="post",
                                      subpath=subpath)
    except ClientError:
        if is_new_action:
            warning_questions = questionary.confirm(
                "WARNING: You have created a new action: '{}', "
                "which was not successfully executed. "
                "If this action does not return any events, "
                "you do not need to do anything. "
                "If this is a custom action which returns events, "
                "you are recommended to implement this action "
                "in your action server and try again."
                "".format(action_name))
            await _ask_questions(warning_questions, sender_id, endpoint)

            payload = ActionExecuted(action_name).as_dict()

            return await send_event(endpoint, sender_id, payload)
        else:
            logger.error("failed to execute action!")
            raise
Log an action to a conversation.
Log an action to a conversation.
Log an action to a conversation .
async def send_action(
    endpoint: EndpointConfig,
    sender_id: Text,
    action_name: Text,
    policy: Optional[Text] = None,
    confidence: Optional[float] = None,
    is_new_action: bool = False
) -> Dict[Text, Any]:
    payload = ActionExecuted(action_name, policy, confidence).as_dict()
    subpath = "/conversations/{}/execute".format(sender_id)
    try:
        return await endpoint.request(json=payload,
                                      method="post",
                                      subpath=subpath)
    except ClientError:
        if is_new_action:
            warning_questions = questionary.confirm(
                "WARNING: You have created a new action: '{}', "
                "which was not successfully executed. "
                "If this action does not return any events, "
                "you do not need to do anything. "
                "If this is a custom action which returns events, "
                "you are recommended to implement this action "
                "in your action server and try again."
                "".format(action_name))
            await _ask_questions(warning_questions, sender_id, endpoint)
            payload = ActionExecuted(action_name).as_dict()
            return await send_event(endpoint, sender_id, payload)
        else:
            logger.error("failed to execute action!")
            raise
async def send_action ( endpoint : EndpointConfig , sender_id : Text , action_name : Text , policy : Optional [ Text ] = None , confidence : Optional [ float ] = None , is_new_action : bool = False ) -> Dict [ Text , Any ] : payload = ActionExecuted ( action_name , policy , confidence ) . as_dict ( ) subpath = "/conversations/{}/execute" . format ( sender_id ) try : return await endpoint . request ( json = payload , method = "post" , subpath = subpath ) except ClientError : if is_new_action : warning_questions = questionary . confirm ( "WARNING: You have created a new action: '{}', " "which was not successfully executed. " "If this action does not return any events, " "you do not need to do anything. " "If this is a custom action which returns events, " "you are recommended to implement this action " "in your action server and try again." "" . format ( action_name ) ) await _ask_questions ( warning_questions , sender_id , endpoint ) payload = ActionExecuted ( action_name ) . as_dict ( ) return await send_event ( endpoint , sender_id , payload ) else : logger . error ( "failed to execute action!" ) raise
Log an action to a conversation.
Log an action to a conversation .
"""Log an action to a conversation."""
endpoint
EndpointConfig
sender_id
Text
action_name
Text
policy
Optional[Text]
confidence
Optional[float]
is_new_action
bool