Empowering agents to take actions during conversations.
ChatGPTAgent
.BaseAction
class.
The BaseAction
class is defined as follows:
ActionsWorker
: how actions are executed and consumedActionsWorker
class plays a crucial role in the async processing of actions within the system. It’s a specialized form of the InterruptibleWorker
class,
designed to handle the execution of actions and passing results back to the agent.
The ActionsWorker
is initialized with an input queue and an output queue. It uses an ActionFactory
instance to create and execute actions based on the inputs it receives.
The flow of actions is as follows:
ActionsWorker
through the worker’s input queue.ActionsWorker
reads the action request from the input queue. It then creates an instance of the appropriate action using the ActionFactory
, and executes it using the provided parameters.ActionOutput
object which encapsulates the result of the action.ActionsWorker
creates an ActionResultAgentInput
from the ActionOutput
, and puts it in its output queue.ActionResultAgentInput
from the queue in its process method. This
result is added to the transcript of the conversation, and can influence the behavior of the agent in subsequent interactions.NylasSendEmail
, which extends the BaseAction
class. It implements the run method to send an email using the Nylas API.