rasa/core/channels/console.py
async def record_messages(server_url=DEFAULT_SERVER_URL,
                          auth_token=None,
                          sender_id=UserMessage.DEFAULT_SENDER_ID,
                          max_message_limit=None,
                          use_response_stream=True):
    """Read messages from the command line and print bot responses."""

    auth_token = auth_token if auth_token else ""

    exit_text = INTENT_MESSAGE_PREFIX + 'stop'

    cliutils.print_success("Bot loaded. Type a message and press enter "
                           "(use '{}' to exit): ".format(exit_text))

    num_messages = 0
    while not utils.is_limit_reached(num_messages, max_message_limit):
        text = get_cmd_input()
        if text == exit_text or text is None:
            break

        if use_response_stream:
            bot_responses = send_message_receive_stream(server_url,
                                                        auth_token,
                                                        sender_id, text)
            async for response in bot_responses:
                print_bot_output(response)
        else:
            bot_responses = await send_message_receive_block(server_url,
                                                             auth_token,
                                                             sender_id, text)
            for response in bot_responses:
                print_bot_output(response)

        num_messages += 1
    return num_messages
Read messages from the command line and print bot responses.
Read messages from the command line and print bot responses.
Read messages from the command line and print bot responses .
async def record_messages(server_url=DEFAULT_SERVER_URL,
                          auth_token=None,
                          sender_id=UserMessage.DEFAULT_SENDER_ID,
                          max_message_limit=None,
                          use_response_stream=True):
    auth_token = auth_token if auth_token else ""
    exit_text = INTENT_MESSAGE_PREFIX + 'stop'
    cliutils.print_success("Bot loaded. Type a message and press enter "
                           "(use '{}' to exit): ".format(exit_text))
    num_messages = 0
    while not utils.is_limit_reached(num_messages, max_message_limit):
        text = get_cmd_input()
        if text == exit_text or text is None:
            break
        if use_response_stream:
            bot_responses = send_message_receive_stream(server_url,
                                                        auth_token,
                                                        sender_id, text)
            async for response in bot_responses:
                print_bot_output(response)
        else:
            bot_responses = await send_message_receive_block(server_url,
                                                             auth_token,
                                                             sender_id, text)
            for response in bot_responses:
                print_bot_output(response)
        num_messages += 1
    return num_messages
async def record_messages ( server_url = DEFAULT_SERVER_URL , auth_token = None , sender_id = UserMessage . DEFAULT_SENDER_ID , max_message_limit = None , use_response_stream = True ) : auth_token = auth_token if auth_token else "" exit_text = INTENT_MESSAGE_PREFIX + 'stop' cliutils . print_success ( "Bot loaded. Type a message and press enter " "(use '{}' to exit): " . format ( exit_text ) ) num_messages = 0 while not utils . is_limit_reached ( num_messages , max_message_limit ) : text = get_cmd_input ( ) if text == exit_text or text is None : break if use_response_stream : bot_responses = send_message_receive_stream ( server_url , auth_token , sender_id , text ) async for response in bot_responses : print_bot_output ( response ) else : bot_responses = await send_message_receive_block ( server_url , auth_token , sender_id , text ) for response in bot_responses : print_bot_output ( response ) num_messages += 1 return num_messages
Read messages from the command line and print bot responses.
Read messages from the command line and print bot responses .
"""Read messages from the command line and print bot responses."""
server_url
auth_token
sender_id
max_message_limit
use_response_stream