Warning
Do not try to use this in a production environment.
It does not have all the security and safety features that a production AI agent would have. It is for learning purposes only.
- Python 3.x: Ensure you have a compatible version of Python installed (e.g., Python 3.9+).
uv(orpip): The project usesuvfor dependency management and running, which is a fast Python package installer and resolver. You can install it viapip:Alternatively, you can usepip install uv
pipdirectly if you prefer, butuvis recommended by the project's structure.
-
Clone the Repository:
git clone https://github.com/MN-nagy/AIagent.git cd AIagent -
Create a Virtual Environment (Recommended with
uv):uv venv uv pip install -r requirements.txt
If using
pipdirectly:python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Obtain a Google Gemini API Key:
- Go to the Google AI Studio or Google Cloud Console.
- Create a new API key.
-
Configure Environment Variables:
- Create a file named
.envin the root directory of the project (wheremain.pyis located). - Add your Gemini API key to this file:
Replace
GEMINI_API_KEY="YOUR_GEMINI_API_KEY_HERE""YOUR_GEMINI_API_KEY_HERE"with the actual API key you obtained.
- Create a file named
After completing the setup, you can run the agent using uv:
uv run python3 main.py "Your prompt here"For verbose output to debug or see the agent's internal thought process (function calls and tool outputs):
uv run python3 main.py "Your prompt here" -vAIagent/
├── .env
├── main.py
├── config.py
├── requirements.txt
├── pyproject.toml
├── functions/
│ ├── __init__.py
│ ├── call_func.py
│ ├── get_file_content.py
│ ├── get_files_info.py
│ ├── run_python_file.py
│ └── write_file.py
└── calculator/
├── __init__.py
├── main.py
└── pkg/
├── __init__.py
├── calculator.py
└── render.py
Note: Made this while following boot.dev course.