watsonx-chatbot-lab.github.io
A template to embed the watsonx assistant chatbot using GitHub pages
The web chat
of the watsonx assistant provides an easy-to-use chatbot interface that you can
add to your website without writing any code. Here is how you can add the web chat
of your
watsonx assistant into a static web page and host it using GitHub Pages.
-
Frist thing first, use the
Fork
button on the upper right corner of this repository to fork this repository into your namespace. On theCreate a new fork
page, you can just click theCreate fork
button. -
After you fork the repository, you will be redirected to the forked version under your namespace. Click the
Settings
on the very right of the menu on top of the repository name. -
On the
Settings
page, click on thePages
in the navigation menu on the left-hand side. -
In the
Branch
section, select themain
branch from the drop-down list and click theSave
button. -
Open your watsonx assistant editor and get the code snippet by following this instructions
-
Go back to the repository you forked and show the file list view by clicking the
Code
in the menu bar. -
Click on the gear icon in the
About
section -
In the
Website
section, check theUse your GitHub Pages website
checkbox and clickSave Changes
button to save the change.Now you GitHub Pages URL will show up in the
About
section. -
Click the
index.html
file, and you will see the HTML content of the sample file. -
Directly edit the file by clicking the
Pencil
icon on the upper-right corner of the HTML content. -
You should see a comment saying:
<!-- Replace the code below with the web chat code snippet from your watsonx assistant -->
Replace the code below that comment with your web chat code snippet and click theCommit changes...
button on the upper-right corner. In the pop-up widget, edit the commit message you see fit and click theCommit changes
button to save the change. -
Click the
Actions
on the top menu bar, you should see a workflow namedpage build and deployment
is running or finished. Click it to show the workflow details. -
Click on the URL link on the
deploy
node. It will redirect you to the index.html page with the embedded web chat!