agents.remote_agent

Remote agent for connecting to nonlocal and/or nonpython agent.

class parlai.agents.remote_agent.remote_agent.RemoteAgentAgent(opt, shared=None)

Agent which connects over ZMQ to a paired agent. The other agent is launched using the command line options set via add_cmdline_args.

__init__(opt, shared=None)

Runs subprocess command to set up remote partner. Only run the subprocess command once: if using multiple threads, tell the partner how many paired agents to set up so that they can manage the multithreading effectively in their environment. (We don’t run subprocess.Popen for each thread.)

connect()

Bind or connect to ZMQ socket. Requires package zmq.

act()

Send message to paired agent listening over zmq.

share()

Increments port to use when using remote agents in Hogwild mode.

shutdown()

Shut down paired listener with <END> signal.

class parlai.agents.remote_agent.remote_agent.ParsedRemoteAgent(opt, shared=None)

Same as the regular remote agent, except that this agent converts all text into vectors using its dictionary before sending them.

parse(s, split_lines=False)

Returns a parsed (list of indices) version of a string s. Optionally return list of vectors for each line in the string in case you need to know where those are.