Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 3 Next »

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:

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:

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:

// 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”.

Methods

show()

Makes the assistant visible.

  • No labels