Closed domrigoglioso closed 4 years ago
@klshuster
How is the control flow going through classes? I.e. When the message comes from the messenger, which class receives it, and how is it assigned to an agent? When I receive a response from the agent how is it sent back?
Any thoughts on implementing on how to implement this in a local server and client format? Which functions receive and send messages back and forth? (Between server and client, and between server and agent)
Is there anywhere that has more documentation on how the Messenger service was implemented?
Below, I will try my best to diagram exactly what happens, though I'd assume that as you have just abstracted all of this functionality into base classes, you will be pretty familiar with this flow. As an example, I will walk you through what happens with the Websockets` chat service implementation, which can be run locally. I think the following should answer most of your questions above @domrigoglioso.
The following is a somewhat high-level step-by-step view of what's going on for the Websockets implementation.
python ~/ParlAI/parlai/chat_service/services/websocket/run.py --config-path /path/to/config
manager.start_task
is called, the WebsocketManager instantiates a MessageSocketHandleron_message
is called, which passes the message to the Manager_manager_loop_fn
_on_new_message
is called, which puts message in Agent's data queueagent.observe()
(e.g. in Chatbot world), which calls manager's observe_message
function
write_message
to its port, where the player observes it in the UI.Tagging @young-k for visibility and @ideanl as he has direct experience with this.
Implement a chat service that runs in terminal as in #2079.
Runs a server locally that allows you to connect to it through terminal. When you send a message to it, it sends back the response from the agent. Uses the
chat_service
base implementations.