Skip to content

Latest commit

 

History

History

aibot

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

AI Bot using Google Generative AI

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.

Key Features

  • Versatile AI Responses: From blog writing to coding explanations, the bot can tackle diverse tasks.
  • Seamless API Integration: Integrates with Google's Gemini model (gemini-1.5-flash) for content generation.
  • Secure Key Management: Uses python-dotenv to handle sensitive API keys securely.
  • User-Friendly: Easy to set up and use. Just run the bot and start interacting!

Setup Instructions

Follow these steps to set up and run the AI Bot on your local machine.

Step 1: Clone the Repository

If the code is hosted in a repository, clone it using the command:

git clone https://github.com/your-repo-name/ai-bot.git
cd ai-bot

Step 1: Install dependencies required for this script to run

pip install -r requirements.txt

Step 3: Setting Gemini API keys

For linux/mac users

touch .env
echo "GEMINI_API_KEY=your-gemini-api-key-here" >> .env

For Windows users

new-item .env
echo GEMINI_API_KEY=your-gemini-api-key-here > .env

Step 4: Running the script

python AIbot.py

Enjoy talk with chat and have fun

Script Explanation

Here’s a breakdown of what the script does:

Environment Configuration: The script loads the GEMINI_API_KEY from the .env file using dotenv to securely access your API key.

Google Generative AI Configuration: It sets up the google-generativeai library to interface with the Gemini model.

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).

Generating Responses: Based on the user’s input, the bot generates relevant and creative responses using the Gemini 1.5 Flash model.

Disclaimer

  • 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.

  • 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.

  • 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.

  • 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.

  • Ethical Use: Users are encouraged to use the bot ethically and responsibly. Avoid using it to generate harmful, misleading, or abusive content.

  • 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.