1.0.1 • Published 5 months ago
my-chatbot-library v1.0.1
my-chatbot-library
A React library for integrating chatbots that use OpenAI's models into web apps, delivering AI-powered conversations with minimal setup
Install
npm install my-chatbot-library
Usage
import React from 'react'
import { Chatbot } from 'my-chatbot-library'
import 'my-chatbot-library/dist/index.css'
const App = () => (
<Chatbot
nameBot="Botti"
avatar="path/to/avatar.jpg"
url="https://api.openai.com/v1/chat/completions"
token="your-openai-api-key"
model="gpt-4" // example
systemContent="Provide a clear topic or context for the conversation." // Optional
/>
);
Note: The component is fully responsive, ensuring optimal display across all devices and screen sizes.
Chatbot Demo
Here is a preview of how the chatbot looks when it's closed and open:
Chatbot Closed
Chatbot Opened
systemContent
(Optional)
The systemContent
prop allows you to set a specific context or theme for the chatbot's conversation. This context helps the AI to focus on a particular subject, ensuring that responses are more relevant to the chosen topic.
Example:
systemContent="This chatbot will only answer questions about books and literature."
Peer Dependencies
This library is compatible with the following versions of React:
- React 16.x
- React 17.x
- React 18.x
License
MIT © mariagaa993