...
Specifies the server-side definition file for the AI Agent. The file should end in “.agent.json”.
server
Optional URL of the Profound AI server. This property should be specified if the application is running on a separate server.
theme
The theme of the chat UI interface (e.g., "light" or "dark").
...
The brand color used in the chat UIinterface. If a brand color is not specified, the default CSS rules are used.
container
The DOM element where the chat UI will be appendedagent user interface will be created. If not specified, the document body is used.
closeButton
Boolean indicating if the close button is should be present present.
closeTitle
Title The tool tip text for the close button.
sendTitle
Title The tool tip text for the send button.
promptPlaceHolder
Placeholder text for the prompt box.
heading
Heading text for the chat UIinterface.
greeting
Greeting message in to show at the top of the chat UIinterface.
pollInterval
Time interval for polling in milliseconds.
...
init(config)
Initializes the chat UI agent with the given configuration.
show()
Displays the chat UIagent interface.
hide()
Hides the chat UIagent interface.
add(info)
Adds a message to the chat UI. The info object should contain these properties:
message (string)
type (string) - The type controls both the functionality and the look and feel. It corresponds to the equivalent CSS class. Values can include “user-message”, “agent-response”, “greeting”.
clear()
Clears the chat messages and starts a new thread with the agent.
setTheme(newTheme)
Sets the theme of the chat UIinterface (e.g., "light" or "dark").
setBrandColor(newBrandColor)
Sets the brand color of the chat UIinterface. If a brand color is not specified or a null value is passed, the default CSS rules are used for the brand color.
send()
Sends the message from the prompt box to the Profound AI server.
poll()
Polls the server for responses.
...
Displays the loading animation. If a loader message is not provided as a parameter, the default loader message is used.
hideLoader()
Hides the loading animation.
...
Checks if the loader is currently displayed, which indicates that the server is currently processing the user’s request.
destroy()
Destroys the chat UI user interface and cleans up resources.