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.
β
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
git clone https://github.com/your-repo/gemini-chatbot.git
cd gemini-chatbot
npm install # or yarn install
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.
npm run dev # or yarn dev
The app should now be running at: http://localhost:3000 π
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 } }
π¦ gemini-chatbot
β£ π src
β β£ π components
β β β£ π ChatInput.tsx
β β β£ π ChatMessage.tsx
β β β π Header.tsx
β β£ π types
β β β π index.ts
β β£ π App.tsx
β β π index.tsx
β£ π .env.local.example
β£ π package.json
β π README.md
β 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.
- Owner: NP5555
- Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.
π Follow for Updates: GitHub | LinkedIn
π― Star this repo if you like the project! β