Using webchats
A channel is an entry point into your agent, such as a website where you would like to embed your agent, a Slack app, and so on.
watsonx Orchestrate channels webchat
Embedding webchat
To simplify integration with your website, the CLI includes the orchestrate channels webchat embed
command. This command takes the name of an agent and produces a script tag that you can place in the <head></head>
section of your page for the currently active environment.
When targeting the local environment, the command uses your agent’s draft variant. On a production instance, it defaults to using your agent’s live (deployed) variant. Below is an example of the command’s output:
Layout configuration
The watsonx Orchestrate embed supports a flexible layout
object to control how and where the chat UI appears.
Parameter | Type | Default | Description | |
---|---|---|---|---|
rootElementID | string | — | (fullscreen-overlay only) ID of the container node to mount chat into. | |
showLauncher | boolean | true | (fullscreen-overlay only) Show the bubble launcher (true) or | render chat immediately (false). |
layout.form | string | ’float’ | Container mode (‘fullscreen-overlay’, ‘float’, ‘custom’). | |
layout.width | string | — | (float only) Popup width (e.g. ‘350px’, ‘30rem’). | |
layout.height | string | — | (float only) Popup height (e.g. ‘500px’, ‘40rem’). | |
layout.showOrchestrateHeader | boolean | true | Render the standard header bar (true) or hide it | (false). |
layout.customElement | HTMLElement | — | element reference to render into. |
Enabling Secure Embed Flow
To enable security for the Embed experience, follow the steps below using the Embed Settings API:
(Optional): Get Embed Config
Generate IBM Public Key
Generate RS256 Key Pair
For more information, see Generating an RS256 key pair.
If you are only developing, you can use an RSA Key generator, such as CryptoTools.
This will generate the Client Public Key and Client Private Key.
Set Embed Config
These are internal APIs available only in Developer Edition. For SaaS, they need to be exposed via the API Proxy for customer use.