Initial AI service skeleton

This commit is contained in:
Grendgi
2026-06-08 13:23:10 +03:00
commit e2f2adf900
21 changed files with 956 additions and 0 deletions

29
README.md Normal file
View File

@@ -0,0 +1,29 @@
# AI Service
Technical AI job service for Portal workloads.
The first version owns only AI job lifecycle and metrics. Business data stays in
domain services such as `telephony`, `monitoring-tg` and `monitoring-pf`.
## API
- `POST /api/v1/jobs` creates one job.
- `POST /api/v1/jobs/batch` creates many jobs with shared defaults.
- `GET /api/v1/jobs/{id}` returns technical job state and result.
- `POST /api/v1/jobs/{id}/retry` resets failed/running jobs to `pending`.
- `GET /api/v1/stats` returns queue and error counters.
- `GET /healthz` returns process health.
- `GET /readyz` checks PostgreSQL readiness.
## Configuration
- `HTTP_HOST`, default `0.0.0.0`
- `HTTP_PORT`, default `8080`
- `DATABASE_URL`, required
- `MIGRATE_ON_START`, default `true`
## Next integration step
`telephony` should first mirror low-risk analysis jobs into this service while
continuing local processing. Remote execution can then be enabled by feature
flag per task type.