Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 18s
CI / E2E Tests (push) Has been skipped
CodeQL Analysis / CodeQL (javascript-typescript) (push) Failing after 2m15s
Deploy / Build API Image (push) Failing after 28s
Deploy / Build Web Image (push) Failing after 16s
Deploy / Build AI Services Image (push) Failing after 17s
E2E Tests / Playwright E2E (push) Failing after 31s
Security Scanning / Dependency Audit (pnpm) (push) Failing after 3s
Security Scanning / Trivy Scan — API Image (push) Failing after 1m46s
Security Scanning / Trivy Scan — Web Image (push) Failing after 1m7s
Security Scanning / Trivy Scan — AI Services Image (push) Failing after 53s
Security Scanning / Trivy Filesystem Scan (push) Failing after 35s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Security Scanning / Security Gate (push) Failing after 0s
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
Hoàn tất đợt cuối của nhiệm vụ chuyển toàn bộ tài liệu sang tiếng Việt. Đã dịch 22 file `.md` còn sót (~9.7k dòng) — gồm RUNBOOK, audits, docs/architecture, docs/load-testing, libs READMEs và các quick references. Giữ nguyên code blocks, đường dẫn, identifier kỹ thuật, URL và biến môi trường. Co-Authored-By: Paperclip <noreply@paperclip.ing>
70 lines
1.9 KiB
Markdown
70 lines
1.9 KiB
Markdown
# @goodgo/ai-services
|
|
|
|
Microservice AI/ML viết bằng Python FastAPI cho GoodGo Platform.
|
|
|
|
## Các dịch vụ
|
|
|
|
| Dịch vụ | Router | Mô tả |
|
|
|---------|--------|-------------|
|
|
| **AVM** | `/avm` | Mô hình định giá tự động — dự đoán giá bất động sản dựa trên XGBoost |
|
|
| **Moderation** | `/moderation` | Kiểm duyệt nội dung tin đăng (phân tích văn bản + hình ảnh) |
|
|
| **NLP** | `/nlp` | NLP tiếng Việt — trích xuất đặc trưng, hiểu truy vấn tìm kiếm |
|
|
|
|
## Tech Stack
|
|
|
|
- **Python** 3.12+
|
|
- **FastAPI** 0.115 + Uvicorn
|
|
- **XGBoost** 2.1 (mô hình định giá bất động sản)
|
|
- **Underthesea** 6.8 (tokenizer NLP tiếng Việt)
|
|
- **Pydantic** 2.9 (schema request/response)
|
|
|
|
## Quick Start
|
|
|
|
```bash
|
|
# Via Docker (recommended — runs as part of the platform stack)
|
|
docker compose up -d ai-services
|
|
|
|
# Standalone
|
|
cd libs/ai-services
|
|
pip install -e ".[dev]"
|
|
uvicorn app.main:app --reload --port 8000
|
|
```
|
|
|
|
## Cấu trúc dự án
|
|
|
|
```
|
|
libs/ai-services/
|
|
├── app/
|
|
│ ├── main.py # FastAPI app entry point
|
|
│ ├── config.py # Settings (Pydantic BaseSettings)
|
|
│ ├── middleware.py # CORS, rate limiting, error handling
|
|
│ ├── models/ # Pydantic request/response schemas
|
|
│ │ ├── avm.py
|
|
│ │ ├── moderation.py
|
|
│ │ └── nlp.py
|
|
│ ├── routers/ # API route handlers
|
|
│ │ ├── avm.py
|
|
│ │ ├── moderation.py
|
|
│ │ └── nlp.py
|
|
│ └── services/ # Business logic
|
|
│ ├── avm_service.py
|
|
│ ├── moderation_service.py
|
|
│ └── nlp_service.py
|
|
├── tests/ # pytest test suite
|
|
├── Dockerfile # Production container image
|
|
└── pyproject.toml # Dependencies and config
|
|
```
|
|
|
|
## Test
|
|
|
|
```bash
|
|
cd libs/ai-services
|
|
pytest
|
|
```
|
|
|
|
## Health Check
|
|
|
|
```
|
|
GET /health → {"status": "ok"}
|
|
```
|