File size: 2,057 Bytes
9e4bb05 0295563 9e4bb05 d4c0b3e 9e4bb05 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | ---
title: AndesOps AI Backend
emoji: 🤖
colorFrom: purple
colorTo: blue
sdk: docker
app_port: 7860
startup_duration_timeout: 30m
python_version: 3.11
---
# AndesOps AI - Backend API
Real-time Chilean public procurement market intelligence with AI-powered analysis.
## 🚀 Features
- **Real-time Market Data**: Access Mercado Público (Chile's public procurement) API
- **Purchase Orders (OC)**: Monitor purchase orders across Chilean government agencies
- **Tender Analysis**: AI-powered tender matching and recommendation
- **LLM Integration**: Powered by Google Gemini, Groq, and Featherless AI
- **REST API**: Full-featured FastAPI backend
## 📋 Environment Variables Required
Add these in **Settings → Secrets** on Hugging Face:
```
MERCADO_PUBLICO_TICKET=99B4CA8C-C1DF-4E3F-B5CF-C1672D432A91
GEMINI_API_KEY=your_gemini_api_key
GROQ_API_KEY=your_groq_api_key
FEATHERLESS_API_KEY=your_featherless_key
DATABASE_URL=sqlite:///./andesops.db
GEMINI_MODEL=gemini-2.5-flash
```
## 🔗 API Endpoints
- `GET /api/health` - Health check
- `GET /api/tenders?keyword=...` - Search tenders
- `GET /api/tenders/scrape?keyword=...` - Scrape Compra Ágil
- `GET /api/purchase-orders?date=ddmmaaaa` - Get purchase orders
- `POST /api/analyze` - Analyze tender with AI
- `POST /api/company-profile` - Save company profile
## 🔌 CORS Configuration
Automatically enabled for frontend at: `https://{user}-andesai-frontend.hf.space`
## 📦 Backend Stack
- **Framework**: FastAPI 0.109.0
- **Database**: SQLite (local) / MySQL (production)
- **AI Models**: Google Gemini, Groq, Featherless
- **Web Scraping**: httpx, BeautifulSoup4
- **Validation**: Pydantic v2
## 🚦 Status
- ✅ Mercado Público API integration
- ✅ Real-time purchase order monitoring
- ✅ Tender scraping (Compra Ágil)
- ✅ AI-powered analysis
- ✅ CORS configured for frontend integration
## 📞 Support
Part of **AndesOps AI** - a complete platform for Chilean public procurement intelligence.
Connect with the frontend space for the full application experience.
|