Create an instance of an agent in an org. Must provide a connection to an org
and the agent (Bot) API name or ID as part of AgentOptions
.
Activates the agent.
void
Deactivates the agent.
void
Queries BotDefinition and BotVersions (limited to 10) for the bot metadata and assigns:
Returns the ID for this agent.
The ID of the agent (The Bot
ID).
Returns the latest bot version metadata.
the latest bot version metadata
Static
createCreates an agent from a configuration, optionally saving the agent in an org.
a Connection
to an org.
a SfProject
for a local DX project.
a configuration for creating or previewing an agent.
the agent definition
Static
createBeta
Creates AF Script using agent job spec data.
The connection to the org
The agent specification data
Promise
Static
createBeta
Creates agent DSL using AF Script.
The connection to the org
The agent AF Script as a string
Promise
Static
createCreate an agent spec from provided data.
a Connection
to an org.
The configuration used to generate an agent spec.
the agent job spec
Static
listList all agents in the current project.
a SfProject
for a local DX project.
Static
listLists all agents in the org.
a Connection
to an org.
the list of agents
A client side representation of an agent within an org. Also provides utilities such as creating agents, listing agents, and creating agent specs.
Examples
Create a new instance and get the ID (uses the
Bot
ID):const id = new Agent({connection, name}).getId();
Create a new agent in the org:
const myAgent = await Agent.create(connection, project, options);
List all agents in the local project:
const agentList = await Agent.list(project);