A simple chat application powered by the Gemini-pro model from Google Generative AI. This app enables users to ask questions and receive intelligent, real-time responses through a conversational interface. It's built with a Node.js backend using Express and a React frontend.
- AI-Powered Responses: Leverages the Gemini-pro model for dynamic, natural conversations.
- Real-time Interaction: Ask questions and receive instant replies.
- User-Friendly Interface: Clean and intuitive design for seamless usage.
- Chat History: Tracks your previous questions and answers for context.
- Surprise Me Feature: Generates random interesting questions to explore.
-
Clone the repository:
git clone https://github.com/Geek24YT/Gemini-AI-ChatApp.git cd Gemini-AI-ChatApp/Backend
-
Install dependencies:
npm install
-
Set up your environment variables: Create a
.env
file in the backend directory and add your Google Generative AI key:GOOGLE_GEN_AI_KEY=your_api_key_here
-
Start the backend server:
node index.js
-
Navigate to the frontend directory:
cd Gemini-AI-ChatApp/Frontend
-
Install dependencies:
npm install
-
Start the frontend development server:
npm run dev
-
Open your browser and navigate to:
http://localhost:5173
- Start both the backend and frontend servers.
- Open the app in your browser.
- Enter a question in the input box or click on "Surprise Me" for a random question.
- View the AI's response and interact further as needed.
- Clear the chat history using the "Clear" button.
- Express Server: Hosts the API to communicate with the Gemini-pro model.
- Endpoints:
POST /gemini
: Accepts chat history and user input, processes it, and sends a response back.
- React Components: Handles user interactions and displays the conversation.
- State Management: Uses React
useState
to manage chat history and input values.
express
cors
dotenv
@google/generative-ai
react
react-scripts
Add the following variable in a .env
file in the backend directory:
GOOGLE_GEN_AI_KEY=your_api_key_here
Contributions are welcome! If you have ideas to improve this project, feel free to fork the repository, create a feature branch, and submit a pull request.
- Fork the repository
- Create your feature branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/YourFeature
- Open a pull request
- Powered by Google Generative AI
- Inspired by modern conversational AI tools like ChatGPT