Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration for a Chatbot widget #3972

Open
camikazegreen opened this issue Jan 7, 2025 · 0 comments
Open

Configuration for a Chatbot widget #3972

camikazegreen opened this issue Jan 7, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@camikazegreen
Copy link
Contributor

camikazegreen commented Jan 7, 2025

Motivation

UITS is developing new chatbot functionality that will allow the owners of websites to quickly create chatbots that are trained on the data contained in a curated list of sites. These can currently be easily added to websites by adding a javascript snippet in a block, but providing a module will make it easier add them and also to keep track of which sites are using these chatbots.

Proposed Resolution

Describe the solution you'd like

I would like a module created that will add a configuration option to the Quickstart Settings page (/admin/config/az-quickstart/settings) with one field for the chatbot URL.

Once configured with a valid URL, a block will be placed in an appropriate region to be displayed on every page and contains the following code:

<script>
        function loadAndExecuteScript(url) {
            return new Promise((resolve, reject) => {
                const script = document.createElement('script');
                script.src = url;
                script.async = true;

                script.onload = () => {
                    console.log(`Script from ${url} has been loaded and executed successfully.`);
                    resolve();
                };

                script.onerror = (error) => {
                    console.error(`Failed to load script from ${url}:`, error);
                    reject(error);
                };

                document.head.appendChild(script);
            });
        }
                loadAndExecuteScript('**URL goes here**')
                    .then(() => {
                        console.log('Script execution completed.');
                    })
                    .catch((error) => console.error('Script execution failed:', error));

        </script>

Describe alternatives you've considered

We could continue to just drop the code snippet in a block, but this feels like a better experience and will make it easier to keep track of which sites are using this feature in the case that targeted communications are needed in the future.

Roles and Permissions considerations

A clear and concise description of how each of the following roles would be impacted by this change:

  • Anonymous user
  • Authenticated user
  • Content editor
  • Content administrator (Required to configure the module)
  • Administrator (Required to enable the module)

Additional context

You can see an example of this chatbot in action on housing.arizona.edu
Another example chatbot for web services can be tested here: https://test.chatbot.d2l.arizona.edu/arizona/nosso/webservice/webservice001?iframe=1

Close coordination will be needed with the service owner of the chatbot service, Jay Timsina, around appropriate documentation and service request forms, etc.

@joeparsons joeparsons added the enhancement New feature or request label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants