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

react-gemini-ai-chatbot

v1.0.0

Published

React AI Chatbot is a React component package that allows developers to easily integrate a chatbot powered by Google's Gemini AI model into their client websites for help desk purposes, queries, and more.

Downloads

6

Readme

React Gemini AI Chat bot

React AI Chatbot is a React component package that allows developers to easily integrate a chatbot powered by Google's Gemini AI model into their client websites for help desk purposes, queries, and more.

Features

  • Integration of Google's Gemini AI model for conversational interactions.
  • Customizable chatbot appearance and behavior.
  • Predefined training data structure for easy setup.
  • Support for training prompts to guide AI model interactions.

Installation

Install react-ai-chatbot with npm

npm install react-gemini-ai-chatbot

Install react-ai-chatbot with yarn

yarn add react-gemini-ai-chatbot

Basic usage

Step 1: Generate API Key

Before using the React AI Chatbot component, you need to generate an API key from the(Google AI Studio). This API key will be used to authenticate requests to the Gemini AI model.

Step 2: Import ReactAiChatBot

To use the React AI Chatbot component, simply import it into your React application and pass the required props:

import React from "react";
import { ReactAiChatBot } from "react-gemini-ai-chatbot";

const MyChatbot = () => {
  const geminiApiKey = "YOUR_GEMINI_API_KEY";
  const trainingData = [{}]

  return (
    <ReactAiChatBot
      geminiApiKey={geminiApiKey}
      trainingData={trainingData}
      // Add other props as needed
    />
  );
};

export default MyChatbot;

Predefined Example

To help you get started quickly, the package includes a predefined example of a fitness club. However, it's essential to customize this data according to your specific requirements before deploying the chatbot in your application.

Props

The following props are available for customization:

| Prop | Description | | --------------- | ---------------------------------------------------------------------- | | geminiApiKey | API key for the Gemini AI service. | | style | Custom styles to be applied to the chatbot component. | | primaryColor | Primary color for the chatbot component. | | secondaryColor | Secondary color for the chatbot component. | | textColor | Text color for the chatbot component. | | backgroundColor | Background color for the chatbot component. | | width | Width of the chatbot component. | | height | Height of the chatbot component. | | geminiModel | Model name for the Gemini AI service. | | chatbotName | Name of the chatbot. | | chatBotImg | Image URL for the chatbot avatar. | | chatTitle | Title for the chat interface. | | trainingData | Training data for the chatbot. | | trainingPrompt | Prompt for the chatbot to use during training. | | loadingComp | Loading component displayed while the chatbot is processing a request. |

Training Data

The trainingData prop in the ReactAiChatBot component requires JSON-formatted data containing all the necessary information about your service, company, or any other relevant content. This data is crucial for training the AI model to understand and respond to user queries effectively.

[
  {
    "name": "Services",
    "subcategories": [
      {
        "name": "Overview",
        "details": [
          "Our fitness center name is 'Golds gym'",
          "State-of-the-art gym equipment",
          "Personalized training programs",
          "Group fitness classes",
          "Nutritional counseling"
        ]
      },
      {
        "name": "Prices",
        "details": [
          { "plan": "Basic Membership", "price": "$30/month" },
          { "plan": "Premium Membership", "price": "$50/month" },
          { "plan": "Personal Training Session", "price": "$50/hour" },
          { "plan": "Group Fitness Class", "price": "$10/class" }
        ]
      }
      // Add more subcategories as needed
    ]
  },
  {
    "name": "Location",
    "subcategories": [
      {
        "name": "Address",
        "details": "123 Fitness Street, City, Country"
      },
      {
        "name": "Map",
        "details": "https://maps.app.goo.gl/WcpDGC6NRXohbC6r7"
      }
    ]
  }
  // Add more categories as needed
]