...
Code Block | ||
---|---|---|
| ||
profound.ai.startAgent({ agent: "HR.agent.json", heading: "HR Assistant", greeting: "How can I help?"embed: true }); |
After an agent is started, you can use various methods of profound.ai.agent to control it. For example:
...
When set to true, instead of starting the agent interface immediately, a chat icon is rendered in the bottom right corner of the application.
heading
Heading Overrides the heading text for the chat interface.
greeting
Greeting Overrides the greeting message to show at the top of the chat interface.
...
Optional URL of the Profound AI server. This property should be specified if the application is running on a server is that is separate from Profound AI.
jwt
theme
The Provides a JSON Web Token to facilitate authentication into Profound AI. The token can be supplied either as a static value to be used at the start of an agent conversation or as a function. When provided as a function, the token will be re-evaluated with every agent interaction.
theme
Sets the theme of the chat interface (e.g., "light" or "dark").
brandColor
The Overrides the brand color used in the chat interface. If a brand color is not specified, the default CSS rules are used.
...
Boolean indicating if the close button should be present present.
closeTitle
The tool tip text for the close button.
...
Checks if the loader is currently displayed, which indicates that the server is currently processing the user’s request.
removeEmbedIcon()
Removes the embedded chat icon in the corner of the screen. You can use this method when navigating away from a screen in a single page application. The method is accessible both from the profound.ai.agent
and the profound.ai
client-side objects. The following 2 method calls are equivalent:
Code Block | ||
---|---|---|
| ||
// This method call is preferred and will work even when an agent is not started
profound.ai.removeEmbedIcon();
// This method call will only work if an agent is already started
profound.ai.agent.removeEmbedIcon(); |
destroy()
Destroys the chat user interface and cleans up resources.