This project is a React-based ChatBot application integrated with Google Generative AI for generating conversational responses. Users can send messages to the chatbot, and it will reply with AI-generated responses.
- Real-time chat interface.
- Uses Google Generative AI (
gemini
model) for responses. - Interactive and dynamic message display.
-
Clone the repository:
git clone https://github.com/PeakScripter/chatbot.git cd chatbot
-
Install dependencies:
npm install
-
Set up Google Generative AI API:
- Replace the placeholder API key in
src/components/ChatBot.js
:const genAI = new GoogleGenerativeAI("YOUR_API_KEY_HERE");
- Replace the placeholder API key in
-
Start the development server:
npm start
- Navigate to the application in your browser at
http://localhost:3000
. - Enter a message in the input field and click "Send."
- View the chatbot's AI-generated response below your message.
chatbot/
├── src/
│ ├── components/
│ │ ├── ChatBot.js # ChatBot component
│ │ ├── chatbot.css # Styling for the ChatBot
│ ├── index.js # Entry point for the React application
├── public/
│ ├── index.html # HTML template
├── package.json # Project metadata and dependencies
- React: JavaScript library for building user interfaces.
- @google/generative-ai: Library for interacting with Google Generative AI.
- Make sure to replace the API key in
ChatBot.js
with a valid Google Generative AI API key. - Ensure that you have access to the
gemini
model in your Google Generative AI account.