An AI-powered coding assistant that uses Google's Gemini AI to help with various code-related tasks. The agent can analyze code, fix bugs, write new features, and provide technical assistance across different programming projects.
- AI Coding Assistant: Interact with Gemini AI for general coding tasks:
- Code analysis and debugging
- Feature implementation
- Code refactoring and optimization
- Technical documentation
- Test case generation
- Example Project - Calculator Module: A sample Python calculator demonstrating the agent's capabilities:
- Basic operations (add, subtract, multiply, divide)
- Complex expressions with proper operator precedence (e.g.,
3*2+5) - Safe expression evaluation using Python's AST parser
ai-coding-agent/
├── main.py # AI coding agent entry point
├── calculator/
│ ├── main.py # Calculator CLI application
│ └── pkg/
│ ├── calculator.py # Calculator implementation
│ └── tests.py # Unit tests for calculator
├── functions/ # Tool functions for AI agent
└── pyproject.toml # Project dependencies
- Python >= 3.13
- uv (Python package manager)
- Google Gemini API key
- Clone the repository:
git clone <repository-url>
cd ai-coding-agent- Install dependencies:
uv sync- Create a
.envfile with your Gemini API key:
GEMINI_API_KEY=your_api_key_hereRun the AI coding agent with a prompt:
uv run main.py "Your question or task here"With verbose output:
uv run main.py "Your question or task here" --verboseThe agent has access to tools that can:
- List files and directories
- Read file contents
- Write files
- Execute Python files
Run the calculator with a mathematical expression:
python calculator/main.py "3*2+5"Example expressions:
"10/2-1"→ Result: 4"2+3*4"→ Result: 14 (multiplication has higher precedence)"8/2*3"→ Result: 12
Navigate to the calculator package directory and run the tests:
cd calculator/pkg
python -m unittest tests.pyThe Calculator class provides the following methods:
from calculator.pkg.calculator import Calculator
calc = Calculator()
# Basic operations
calc.add(2, 3) # Returns 5
calc.subtract(5, 2) # Returns 3
calc.multiply(3, 4) # Returns 12
calc.divide(10, 2) # Returns 5
# Evaluate complex expressions
calc.evaluate("3*2+5") # Returns 11This project uses:
- uv for dependency management
- Google Gemini AI for AI-powered assistance
- Python AST for safe expression evaluation
MIT License