npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@cristianglezm/vue-chatbot-widget

v0.0.8

Published

[![cd](https://github.com/cristianglezm/vue-chatbot-widget/actions/workflows/cd.yml/badge.svg?branch=master)](https://github.com/cristianglezm/vue-chatbot-widget/actions/workflows/cd.yml) [![pkg](https://github.com/cristianglezm/vue-chatbot-widget/actions

Downloads

9

Readme

Chat Bot Widget Component Library

cd pkg NPM Version GitHub package.json version (branch)

The ChatBotWidget is designed to enhance your web application. It empowers users to specify actions, retrieve information from documents using a basic Retrieval-Augmented Generation (RAG) system, and access text-to-audio features for an improved and inclusive user experience.

⚠️ Important

Warning: The default chatbot model has not yet been trained for production use. Some features may be limited or not function as expected. For best results, consider using a custom model or adapting the configuration to meet your needs.

Features

  1. Agent Capabilities Leverages agent functionality to interpret and perform user-specified actions effectively.
  2. Simple RAG (Retrieval-Augmented Generation) System Integrates a basic RAG system, allowing the chatbot to consult external documents to enhance responses.
  3. Local / Remote it lets you use a local or remote server compatible with OpenAI API.
  4. Text-to-Audio Conversion Generates audio for text responses, providing an accessible and interactive user experience. Includes options for manual playback or automatic audio generation after responses.

Installation

You can install the package from npm.

npm i @cristianglezm/vue-chatbot-widget

If you plan to use all the components you will need to initizalize the pinia store and add ChatBotPlugin into the app.

// app main.ts
import { createApp } from 'vue'
import { createPinia } from 'pinia';
// import the plugin
import ChatBotPlugin from '@cristianglezm/vue-chatbot-widget';
import './style.css'

import App from './App.vue'

const app = createApp(App);
const pinia = createPinia();
// registers the pinia store
app.use(pinia);
// and the ChatBot components
app.use(ChatBotPlugin, { pinia });
app.mount('#app')

If you plan to only use a component you can just call initStores({ pinia }) instead.

// app main.ts
import { createApp } from 'vue'
import { createPinia } from 'pinia';
import { initStores } from '@cristianglezm/vue-chatbot-widget';
import './style.css'

import App from './App.vue'

const app = createApp(App);
const pinia = createPinia();
// registers the pinia store
app.use(pinia);
// init stores for the chatbot components.
initStores({ pinia });
app.mount('#app')

Usage

  1. Using System Only

This method configures the chatbot with a system message.

<script setup>
import { onMounted } from 'vue';
import { ChatBotWidget } from '@cristianglezm/vue-chatbot-widget';
import mitt from 'mitt';
// emitter to be able to load models from outside the chatbot.
const emitter = mitt();
// onMounted(() => {
//    emitter.emit('ChatBotWidget#loadChatBotModel'); // load the llm
//    emitter.emit('ChatBotWidget#loadKokoroModel'); // load the tts
// });
// no need to pass emitter if not needed.
</script>
<template>
  <ChatBotWidget
    :emitter="emitter"
    :system="'You are a helpful assistant to assist the user.'"
    :greetings="'Hello! How can I assist you today?'"
  />
</template>
  1. Using Chat Template Only

If you want to use a custom chat template (from @huggingface/jinja), specify it using the :chat-template prop.

When tools and documents are provided, they will be injected into the chat template, to be able to use tools you will need to provide your own executor function. the chat template should have a tools|tojson and a for doc in documents, review the chat_template in main.ts

<script setup>
import { ChatBotWidget, chat_template } from '@cristianglezm/vue-chatbot-widget';

const tools = [
    {
        "name": "makeFlower",
        "description": "Makes a flower",
        "parameters": {}
    },
    {
        "name": "mutate",
        "description": "Mutates a flower given the ID",
        "parameters": {
            "id": {
                "description": "Flower ID",
                "type": "int",
                "required": true
            }
        }
    }
];
const documents = [
    {
        "title":"title to use as embeddings and key to get the content with a tool",
        "content":"information for the user"
    },
];
</script>
<template>
  <ChatBotWidget
    :greetings="'Hello! How can I assist you today?'"
    :chat-template="chat_template"
    :tools="tools"
    :documents="documents"
    :executor="parseAndExecCommand"
  />
</template>

Props

| Prop | Type | Description | |----------------|------------|---------------------------------------------------------------------| | emitter | Object | Mitt event bus to be able to load the model from outside the ChatBotWidget. | | system | String | Predefined system message for chatbot behavior. | | greetings | String | Initial message displayed to the user. | | chat-template| String | Custom @huggingface/jinja template for chatbot interaction. | | tools | Array | Array of tools available for chatbot execution. | | documents | Array | Array of documents injected into the chat template. | | executor | Function | Function responsible for parsing and executing commands. | | editable | Boolean | Enables or disables the editable mode. | | config | Object | Custom configuration object for additional settings. |

emitter.emit('ChatBotWidget#loadChatBotModel'); // load the llm
emitter.emit('ChatBotWidget#loadKokoroModel'); // load the tts

refer to src/component/chatbotwidget.vue

Constributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

License

This library is distributed under the Apache 2.0. See License for more information.

The Monaspace font is distributed under the STL Open Font License. See License for more information.