Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Starting an AI Agent

Starting an agent within your Web application involved calling the profound.ai.startAgent() API and passing a configuration object parameter. For example:

Code Block
languagejs
profound.ai.startAgent({
  agent: "HR.agent.json",
  heading: "HR Assistant",
  greeting: "How can I help?"
});

After an agent is started, you can use various methods of profound.ai.agent to control it. For example:

Code Block
languagejs
profound.ai.agent.hide(); // Hide the agent
profound.ai.agent.show(); // Show the agent

It is also possible to manage multiple instances of an agent by using the profound.ai.Chat class. For example:

Code Block
languagejs
// Start the Sales Assistant initially
const salesAgent = new profound.ai.Chat();
salesAgent.init({
  agent: "sales.agent.json",
  heading: "Sales Assistant"
});
salesAgent.show();

// Now, hide the Sales Assistant and show the Support Assistant
salesAgent.hide();
const supportAgent = new profound.ai.Chat();
supportAgent.init({
  agent: "support.agent.json",
  heading: "Support Assistant"
});
supportAgent.show();

Configuration Properties

agent

Specifies the server-side definition file for the AI Agent. The file should end in “.agent.json”.