rasa/core/training/interactive.py
def format_bot_output(
    message: Dict[Text, Any]
) -> Text:
    """Format a bot response to be displayed in the history table."""

    # First, add text to output
    output = message.get("text") or ""

    # Then, append all additional items
    data = message.get("data", {})
    if not data:
        return output

    if data.get("image"):
        output += "\nImage: " + data.get("image")

    if data.get("attachment"):
        output += "\nAttachment: " + data.get("attachment")

    if data.get("buttons"):
        output += "\nButtons:"
        for idx, button in enumerate(data.get("buttons")):
            button_str = button_to_string(button, idx)
            output += "\n" + button_str

    if data.get("elements"):
        output += "\nElements:"
        for idx, element in enumerate(data.get("elements")):
            element_str = element_to_string(element, idx)
            output += "\n" + element_str

    if data.get("quick_replies"):
        output += "\nQuick replies:"
        for idx, element in enumerate(data.get("quick_replies")):
            element_str = element_to_string(element, idx)
            output += "\n" + element_str
    return output
Format a bot response to be displayed in the history table.
Format a bot response to be displayed in the history table.
Format a bot response to be displayed in the history table .
def format_bot_output(
    message: Dict[Text, Any]
) -> Text:
    output = message.get("text") or ""
    data = message.get("data", {})
    if not data:
        return output
    if data.get("image"):
        output += "\nImage: " + data.get("image")
    if data.get("attachment"):
        output += "\nAttachment: " + data.get("attachment")
    if data.get("buttons"):
        output += "\nButtons:"
        for idx, button in enumerate(data.get("buttons")):
            button_str = button_to_string(button, idx)
            output += "\n" + button_str
    if data.get("elements"):
        output += "\nElements:"
        for idx, element in enumerate(data.get("elements")):
            element_str = element_to_string(element, idx)
            output += "\n" + element_str
    if data.get("quick_replies"):
        output += "\nQuick replies:"
        for idx, element in enumerate(data.get("quick_replies")):
            element_str = element_to_string(element, idx)
            output += "\n" + element_str
    return output
def format_bot_output ( message : Dict [ Text , Any ] ) -> Text : output = message . get ( "text" ) or "" data = message . get ( "data" , { } ) if not data : return output if data . get ( "image" ) : output += "\nImage: " + data . get ( "image" ) if data . get ( "attachment" ) : output += "\nAttachment: " + data . get ( "attachment" ) if data . get ( "buttons" ) : output += "\nButtons:" for idx , button in enumerate ( data . get ( "buttons" ) ) : button_str = button_to_string ( button , idx ) output += "\n" + button_str if data . get ( "elements" ) : output += "\nElements:" for idx , element in enumerate ( data . get ( "elements" ) ) : element_str = element_to_string ( element , idx ) output += "\n" + element_str if data . get ( "quick_replies" ) : output += "\nQuick replies:" for idx , element in enumerate ( data . get ( "quick_replies" ) ) : element_str = element_to_string ( element , idx ) output += "\n" + element_str return output
Format a bot response to be displayed in the history table.
Format a bot response to be displayed in the history table .
"""Format a bot response to be displayed in the history table.""" # First, add text to output # Then, append all additional items
message
Dict[Text, Any]