StaticcreateCreates 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
StaticcreateCreate an agent spec from provided data.
a Connection to an org.
The configuration used to generate an agent spec.
the agent job spec
StaticinitStaticlistList all agents in the current project.
a SfProject for a local DX project.
StaticlistLists all agents available for preview, combining agents from the org and local script files.
a Connection to an org.
a SfProject for a local DX project.
the list of previewable agents with their source (org or script)
StaticlistLists all agents in the org.
a Connection to an org.
the list of agents
A client side representation of an agent. Also provides utilities such as creating agents, listing agents, and creating agent specs.
Examples
Create a new instance and get the ID (uses the
BotID):const id = await Agent.init({connection, project, apiNameOrId: 'myBot' }).getId();Create a new instance of an agent script based agent
const agent = await Agent.init({connection, project, aabName: 'myBot' });
Start a preview session
const agent = await Agent.init({connection, project, aabName: 'myBot' }); await agent.preview.start(); await agent.preview.send('hi there');
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);