- class CLIMessengerInterface(intro=None, prompt_request='request: ', prompt_response='response: ', out_descriptor=None)[source]#
Bases:
PollingMessengerInterface
Command line message interface is the default message interface, communicating with user via STDIN/STDOUT. This message interface can maintain dialog with one user at a time only.
- supported_request_attachment_types = {}#
- supported_response_attachment_types = {}#
- _request()[source]#
Method used for sending users request for their input.
- Return type:
List
[Tuple
[Message
,Any
]]- Returns:
A list of tuples: user inputs and context ids (any user ids) associated with the inputs.
- _respond(responses)[source]#
Method used for sending users responses for their last input.
- Parameters:
responses (
List
[Context
]) – A list of contexts, representing dialogs with the users; last_response, id and some dialog info can be extracted from there.
- async connect(pipeline_runner, **kwargs)[source]#
The CLIProvider generates new dialog id used to user identification on each connect call.
- Parameters:
pipeline_runner (
PipelineRunnerFunction
) – A function that should process user request and return context; usually it’s a_run_pipeline()
function.**kwargs – argument, added for compatibility with super class, it shouldn’t be used normally.