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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@peyushx/chatbot-ai

v2.1.0

Published

A customizable AI-driven chatbot module for Angular applications, enabling easy integration with backend APIs, flexible UI customization, and real-time interaction capabilities.

Downloads

464

Readme

@peyushx/chatbot-ai

A customizable AI-driven chatbot module for Angular applications that facilitates easy integration of a chatbot with personalized features and a customizable UI.

Features

  • Real-time fetching and displaying of chatbot responses via backend APIs.
  • Fully customizable chatbot interface including titles and color schemes.
  • Input configuration for API URLs for fetching chat suggestions and sending chat responses.

Installation

To install the package in your Angular project, execute the following command in your terminal:

npm install @peyushx/chatbot-ai

Usage

Integrate the chatbot module into your Angular project with these steps:

1. Import Required Modules in AppModule

Import ChatbotModule along with other required modules such as HttpClientModule, MarkdownModule, and BrowserAnimationsModule into your Angular app’s main module (app.module.ts):

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MarkdownModule } from 'ngx-markdown';
import { AppComponent } from './app.component';
import { ChatbotModule } from '@peyushx/chatbot-ai';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    HttpClientModule,
    MarkdownModule.forRoot(),
    BrowserAnimationsModule,
    ChatbotModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {}

2. Add the Chatbot Component to Your HTML Template

Insert the app-chatbot component in your HTML template where you want the chatbot to appear. Configure the component with appropriate properties like API URLs, user name, and color theme:

<app-chatbot
  [primaryColor]="'blue'"
  [secondaryColor]="'#d3dfff'"
  [chatApiUrl]="'http://localhost:8080/api/chatbot/conversation'"
  [suggestionApiUrl]="'http://localhost:8080/api/chatbot/suggestions'"
  [userName]="'Piyush'"
  [chatBotTitle]="'Evolix Chatbot'"
></app-chatbot>

Customization Options

Configure and customize the chatbot with the following properties:

| Input | Type | Description | Default Value | |--------------------|------------|-----------------------------------------------------------------|-----------------------------------------------| | suggestionApiUrl | string | The API URL to fetch chatbot suggestions. | "" | | chatApiUrl | string | The API URL to send user queries and receive responses. | "" | | userName | string | The name of the user interacting with the chatbot. | "Guest" | | primaryColor | string | Primary color of the chatbot UI. | '#d9232d' | | secondaryColor | string | Secondary color of the chatbot UI. | '#ffeaea' | | chatBotTitle | string | The title displayed in the chatbot UI. | "Chatbot" |

Development

Interested in contributing to this module? Here’s how you can set up a development environment:

git clone https://github.com/yourusername/chatbot-ai
cd chatbot-ai
npm install

Build and Test

  • Building the Library: Run ng build chatbot-ai to compile the module.
  • Running Tests: Execute ng test chatbot-ai to run unit tests.

License

This project is licensed under the MIT License - see the LICENSE file for details.