Create an instance of an agent in an org. Must provide a connection to an org
and the agent (Bot) API name as part of AgentOptions
.
Returns the ID for this agent.
The ID of the agent (The Bot
ID).
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
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.
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);