How guinogueira21/fastapi-gemini-agent works
This is a small FastAPI chat service. A client posts a prompt to the chat route; the route applies an in-memory rate limit, then calls a Gemini adapter and returns its response. The service loads a system prompt from a Markdown file and configures the adapter with an environment-provided API key. The abstract AI interface is the internal extension layer. The source excerpts show these calls and configuration; no broader capabilities are documented.
Main entry points: main.py FastAPI Chat API · gemini.py Gemini Adapter · throttling.py Request Throttler · system_prompt.md System Prompt
Components 7
HTTP API
- FastAPI Chat API
src/main.py
Rate Limiting
- Request Throttler
src/auth/throttling.py
AI Integration
- System Prompt
src/prompts/system_prompt.md - AI Platform Interface
src/ai/base.py - Gemini Adapter
src/ai/gemini.py
Other components
- API Client
- Google Gemini API
Connections 7
- API Client → FastAPI Chat API: posts prompt
src/main.py - FastAPI Chat API → Request Throttler: checks limit
src/main.py - FastAPI Chat API → Gemini Adapter: sends prompt
src/main.py - FastAPI Chat API → System Prompt: loads prompt
src/main.py - Gemini Adapter → AI Platform Interface: implements
src/ai/gemini.py - Gemini Adapter → Google Gemini API: generates content
src/ai/gemini.py - FastAPI Chat API → API Client: returns response
src/main.py