Documentation Index
Fetch the complete documentation index at: https://staging.docs.vocode.dev/llms.txt
Use this file to discover all available pages before exploring further.
Note: Support for actions is currently limited to ChatGPTAgent.
What are actions?
Actions refer to specific tools an agent can execute during the conversation. These actions can encompass various activities like writing an email, scheduling an appointment, and so forth. They are implemented as classes derived from theBaseAction class.
The BaseAction class is defined as follows:
Agent Actions
The agent is responsible for managing and executing actions within a conversation. The agent consumes a configuration object at instantiation, which specifies the actions that the agent can perform. The agent configuration lists the actions available to the agent:ActionsWorker: how actions are executed and consumed
The ActionsWorker 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:
- Agent sends action requests to the
ActionsWorkerthrough the worker’s input queue. ActionsWorkerreads the action request from the input queue. It then creates an instance of the appropriate action using theActionFactory, and executes it using the provided parameters.- The executed action returns an
ActionOutputobject which encapsulates the result of the action. ActionsWorkercreates anActionResultAgentInputfrom theActionOutput, and puts it in its output queue.- The agent then consumes the
ActionResultAgentInputfrom 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.
Implementing your own action: Nylas email example
In this section, we provide an example of an action,NylasSendEmail, which extends the BaseAction class. It implements the run method to send an email using the Nylas API.
