|
| 1 | +# AI Bot using Google Generative AI |
| 2 | + |
| 3 | +This AI bot is designed to perform a wide range of tasks, such as writing blog posts, explaining code, or creating creative stories. It uses **Google's Gemini API** via the `google-generativeai` package to generate intelligent and creative responses to user queries. With a simple and secure setup, this bot makes interacting with AI effortless and enjoyable. |
| 4 | + |
| 5 | +## Key Features |
| 6 | + |
| 7 | +- **Versatile AI Responses**: From blog writing to coding explanations, the bot can tackle diverse tasks. |
| 8 | +- **Seamless API Integration**: Integrates with **Google's Gemini model (gemini-1.5-flash)** for content generation. |
| 9 | +- **Secure Key Management**: Uses `python-dotenv` to handle sensitive API keys securely. |
| 10 | +- **User-Friendly**: Easy to set up and use. Just run the bot and start interacting! |
| 11 | + |
| 12 | +## Setup Instructions |
| 13 | + |
| 14 | +Follow these steps to set up and run the AI Bot on your local machine. |
| 15 | + |
| 16 | +### Step 1: Clone the Repository |
| 17 | +If the code is hosted in a repository, clone it using the command: |
| 18 | +```bash |
| 19 | +git clone https://github.com/your-repo-name/ai-bot.git |
| 20 | +cd ai-bot |
| 21 | +``` |
| 22 | +### Step 1: Install dependencies required for this script to run |
| 23 | +``` |
| 24 | +pip install -r requirements.txt |
| 25 | +``` |
| 26 | + |
| 27 | +### Step 3: Setting Gemini API keys |
| 28 | +## For linux/mac users |
| 29 | +``` |
| 30 | +touch .env |
| 31 | +echo "GEMINI_API_KEY=your-gemini-api-key-here" >> .env |
| 32 | +``` |
| 33 | +## For Windows users |
| 34 | +``` |
| 35 | +new-item .env |
| 36 | +echo GEMINI_API_KEY=your-gemini-api-key-here > .env |
| 37 | +``` |
| 38 | +### Step 4: Running the script |
| 39 | +``` |
| 40 | +python AIbot.py |
| 41 | +``` |
| 42 | + |
| 43 | +## Enjoy talk with chat and have fun |
| 44 | +### Script Explanation |
| 45 | +Here’s a breakdown of what the script does: |
| 46 | + |
| 47 | +Environment Configuration: The script loads the GEMINI_API_KEY from the .env file using dotenv to securely access your API key. |
| 48 | + |
| 49 | +Google Generative AI Configuration: It sets up the google-generativeai library to interface with the Gemini model. |
| 50 | + |
| 51 | +User Interaction: The script continuously prompts the user for input. Users can ask anything from writing tasks (e.g., generating blog posts) to technical queries (e.g., explaining code). |
| 52 | + |
| 53 | +Generating Responses: Based on the user’s input, the bot generates relevant and creative responses using the *Gemini 1.5 Flash model*. |
| 54 | + |
| 55 | +## Disclaimer |
| 56 | + |
| 57 | +- **API Limitations**: This AI bot relies on the Google Generative AI (Gemini) API. Users should be aware of the API's rate limits and usage policies, as excessive requests may result in temporary suspension of access. |
| 58 | + |
| 59 | +- **Content Accuracy**: The responses generated by the AI bot are based on patterns learned from training data. While the bot aims to provide accurate and relevant information, it may occasionally produce incorrect or misleading content. Users should verify information before relying on it for critical tasks. |
| 60 | + |
| 61 | +- **No Legal or Medical Advice**: The AI bot is not a substitute for professional advice. Users should not rely on the information provided by the bot for legal, medical, or financial decisions. |
| 62 | + |
| 63 | +- **User Responsibility**: By using this bot, users agree to take full responsibility for their interactions with the AI and the content generated. The developers are not liable for any consequences resulting from the use of this bot. |
| 64 | + |
| 65 | +- **Ethical Use**: Users are encouraged to use the bot ethically and responsibly. Avoid using it to generate harmful, misleading, or abusive content. |
| 66 | + |
| 67 | +- **Privacy Considerations**: Any information shared with the bot during interactions may be processed according to Google's data privacy policies. Users should avoid sharing personal or sensitive information. |
0 commit comments