watson-developer-cloud / assistant-toolkit

Toolkit for experimentation with watsonx Assistant
Apache License 2.0
108 stars 115 forks source link

Angular integration fo IBm watson assistant #206

Open ahdbk opened 9 months ago

ahdbk commented 9 months ago

Hey all,

Is there any plan to release an Angular extension for IBM watson webchat ?

Thanks

ethanwinters commented 9 months ago

There is not currently a plan to do so, but if we get enough comments on this issue asking for it, that could change! It shouldn't be too difficult to follow the logic in the React version to re-implement: https://github.com/watson-developer-cloud/assistant-web-chat-react/blob/main/src/WebChatContainer.tsx

TazmanianDI commented 9 months ago

It might be helpful to know more about what you're asking for. Are you just asking for an example for how to use web chat with Angular? Web chat itself is framework agnostic and would work with Angular as it exists today. All that web chat requires is setting the window.watsonAssistantChatOptions object you see in the embed code and then have something load the JavaScript file for web chat from our servers.

ahdbk commented 9 months ago

Indeed you can access the IbmWaston options object even on Angular. But for my use case, I want to have a custom angular component as an action result.

If we want to take an example, image I want to have a custom carousel component build with Angular with injected services that call external API

TazmanianDI commented 9 months ago

I would imagine you can do that with web chat. We have a tutorial that shows how to create a custom content carousel using the web chat custom response (https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-develop-content-carousel). We only have examples for vanilla JS and React but those are just example. I'm not familiar with angular but I would assume it has capabilities to attach Angular elements or components to existing HTML elements. Web chat basically just creates an HTML element and that it's up to you to put stuff into it using whatever framework that is capable of doing that.