0.38.0 • Published 2 years ago

saihubot-html-adapter v0.38.0

Weekly downloads
26
License
MIT
Repository
github
Last release
2 years ago

saihubot-html-adaper

Saihubot basic HTML Adapter and addons

Includes

  • Adapter: saihubot-html-adapter.js
  • Brain: saihubot-html-brain-localforage.js
  • Addons: saihubot-html-addon-search.js (search), saihubot-html-addon-dialog.js (confirm dialog), saihubot-html-addon-card.js (card)
  • Skills: saihubot-html-skill-help.js (show help), saihubot-html-skill-qrcode.js (render qrcode)

Features

  • Written in plain Javascript, compatible with modern browsers
  • Each message can be customized with any HTML elements
  • Reference chat UI style is included

Bootstrap HTML Saihubot

npm install saihubot saihubot-html-adapter saihubot-skill-diagnostics

Then includes the saihubot.js in your HTML file with a div tag for message history and the input field:

<body>
  <div id="history"></div>
  <input id="message"><button id="send">Send</button>
  <script type="module">
    import SaihuBot from './node_modules/saihubot/src/saihubot.js';
    import htmlAdapter from './node_modules/html-adapter/saihubot-html-adapter.js';
    import { skills } from './node_modules/saihubot-skill-diagnostics/index.js';

    document.addEventListener('DOMContentLoaded', function() {
      new SaihuBot({
        adapter: htmlAdapter,
        skills,
      });
    });
  </script>
</body>

The script is used to bootstrap the Saihubot.

new SaihuBot({});

Wrap that script in DOMContentLoaded event to make sure contents are loaded before running scripts.

You can pass some parameters into it to quickly customize the bot.

0.38.0

2 years ago

0.37.0

3 years ago

0.36.0

3 years ago

0.35.0

3 years ago

0.34.0

3 years ago

0.33.0

3 years ago

0.30.7

3 years ago

0.30.6

4 years ago

0.30.0

4 years ago

0.30.4

4 years ago

0.29.0

4 years ago

0.29.1

4 years ago

0.28.5

4 years ago

0.28.3

4 years ago

0.28.2

4 years ago

0.28.1

4 years ago

0.28.0

4 years ago

0.27.0

4 years ago

0.26.0

4 years ago

0.25.0

4 years ago

0.24.0

4 years ago

0.23.0

4 years ago

0.22.0

4 years ago

0.21.0

4 years ago

0.20.0

4 years ago