Create an instance of the service.
The connection to use to make requests.
The ID of the agent (Bot
ID).
Ends an interactive session with the agent.
A session ID provided by first calling agentPreview.start()
.
A reason why the interactive session was ended.
AgentPreviewEndResponse
Send a message to the agent using the session ID obtained by calling start()
.
A session ID provided by first calling agentPreview.start()
.
A message to send to the agent.
AgentPreviewSendResponse
Start an interactive session with the agent.
AgentPreviewStartResponse
, which includes a session ID needed for other actions.
Enable or disable Apex Debug Mode, which will enable trace flags for the Bot user and create apex debug logs for use within VS Code's Apex Replay Debugger.
Whether to enable or disable Apex Debug Mode.
A service to interact with an agent. Start an interactive session, send messages to the agent, and end the session.
Examples
Create an instance of the service:
const agentPreview = new AgentPreview(connection, botId);
Start an interactive session:
const { sessionId } = await agentPreview.start();
Send a message to the agent using the session ID from the startResponse:
const sendResponse = await agentPreview.send(sessionId, message);
End an interactive session:
await agentPreview.end(sessionId, 'UserRequest');
Enable Apex Debug Mode:
agentPreview.toggleApexDebugMode(true);