Javascript
To add AI assistant to your existing Vanialla JS Code
-
Add this to your head tag
-
Add this inside your HTML body
-
Additionally register your functions. Follow the example below of
addTodo
function -
Add the assistants to the pages you want to
Add the Voice assistant to the pages you want to. If you want to enable it on all the pages, add it to common section.
This will show a mic button on the bottom center of the page. Test it out if you talk with it. This Assistant have no registered actions
Add the Text assistant to the pages you want to. If you want to enable it on all the pages, add it to common section.
This will show a Chat button on the bottom center of the page. Test it out if you talk with it. This Assistant have no registered actions
-
Test The AI Assistant on your App
Go ahead and press the Mic button shown in the Voice Assistant component to interact with the AI Assistant.
You should be able to invoke registered actions like “Add a todo item”.
-
Refine Prompt
Go to Copilot > Select Copilot > Linked Packages
Update, Version, Test & Deploy the prompt