Một dự án AI agent sử dụng Google Gemini API với tích hợp tính năng calculator.
- 🤖 AI Agent sử dụng Google Gemini API
- 🔢 Calculator module với các phép toán cơ bản
- ✅ Unit tests cho calculator
- 🐍 Python 3.12+
- Clone repository:
git clone <your-repo-url>
cd ai_agent- Cài đặt dependencies sử dụng uv:
uv sync- Tạo file
.envvà thêm Gemini API key:
GEMINI_API_KEY=your_api_key_here
uv run main.py "Your prompt here"Calculator hỗ trợ các phép toán cơ bản với ưu tiên operator:
- Cộng (+)
- Trừ (-)
- Nhân (*)
- Chia (/)
from calculator.pkg.calculator import Calculator
calc = Calculator()
result = calc.evaluate("3 + 5 * 2") # Kết quả: 13ai_agent/
├── calculator/
│ ├── pkg/
│ │ └── calculator.py # Calculator class
│ ├── main.py # Calculator demo
│ └── tests.py # Unit tests
├── main.py # AI agent entry point
├── pyproject.toml # Project configuration
└── README.md # Documentation
cd calculator
python -m unittest tests.py- Python 3.12+
- Google Gemini API key
- Dependencies được quản lý bởi uv
google-genai: Google Gemini AI APIpython-dotenv: Environment variables managementtyping-extensions: Type annotations support