Skip to content

πŸš€ Gemini Chatbot - AI-Powered Chat Application Welcome to Gemini Chatbot! This project is a chatbot powered by Google's Gemini AI, built with React and TypeScript. It allows users to interact with an AI assistant and receive responses in real-time.

Notifications You must be signed in to change notification settings

NP5555/AI-ChatBot

Repository files navigation

πŸš€ Gemini Chatbot - AI-Powered Chat Application

Welcome to Gemini Chatbot! This project is a chatbot powered by Google's Gemini AI, built with React and TypeScript. It allows users to interact with an AI assistant and receive responses in real-time.


πŸ“Έ Preview

Mobile Preview Tablet Preview

πŸ“Œ Features

βœ… AI-powered chatbot using Google's Gemini API
βœ… Real-time message handling
βœ… Responsive and modern UI
βœ… Error handling for failed API calls
βœ… Smooth user experience with loading indicators


πŸ›  Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/your-repo/gemini-chatbot.git
cd gemini-chatbot

2️⃣ Install Dependencies

npm install  # or yarn install

3️⃣ Set Up API Keys

You need a valid Gemini API Key from Google. Create a .env.local file in the root directory and add:

NEXT_PUBLIC_GEMINI_API_KEY=your_api_key_here

Make sure to replace your_api_key_here with your actual API key.

4️⃣ Run the Development Server

npm run dev  # or yarn dev

The app should now be running at: http://localhost:3000 πŸš€


πŸ”‘ API Reference

This project uses Google Gemini AI API. Here’s how the API is structured:

  • Endpoint: https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent
  • Headers:
    {
      "Content-Type": "application/json"
    }
  • Request Body:
    {
      "contents": [
        {
          "role": "user",
          "parts": [{ "text": "Hello!" }]
        }
      ],
      "generationConfig": {
        "temperature": 0.7,
        "maxOutputTokens": 2048
      }
    }

πŸ“ Project Structure

πŸ“¦ gemini-chatbot
 ┣ πŸ“‚ src
 ┃ ┣ πŸ“‚ components
 ┃ ┃ ┣ πŸ“œ ChatInput.tsx
 ┃ ┃ ┣ πŸ“œ ChatMessage.tsx
 ┃ ┃ β”— πŸ“œ Header.tsx
 ┃ ┣ πŸ“‚ types
 ┃ ┃ β”— πŸ“œ index.ts
 ┃ ┣ πŸ“œ App.tsx
 ┃ β”— πŸ“œ index.tsx
 ┣ πŸ“œ .env.local.example
 ┣ πŸ“œ package.json
 β”— πŸ“œ README.md

πŸ›‘ Security Notice

⚠ DO NOT expose your API keys publicly. Always use environment variables.

If you accidentally commit your API key, revoke it immediately and generate a new one.


πŸ‘¨β€πŸ’» Contributors & Ownership

  • Owner: NP5555
  • Contributions are welcome! Feel free to open issues or submit pull requests.

πŸ“œ License

This project is licensed under the MIT License.


πŸ”— Follow for Updates: GitHub | LinkedIn
🎯 Star this repo if you like the project! ⭐

About

πŸš€ Gemini Chatbot - AI-Powered Chat Application Welcome to Gemini Chatbot! This project is a chatbot powered by Google's Gemini AI, built with React and TypeScript. It allows users to interact with an AI assistant and receive responses in real-time.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published