feat: Add Files API support with upload, list, get and delete operations

- Implement complete Files API compatible with Gemini API format
- Support resumable file uploads with chunked transfer (tested with 15MB video)
- Create file management service with database tracking
- Add file domain models and API request/response objects
- Implement file routes with proper authentication
- Use fixed API key for Files API requests (due to Google API restrictions)
- Support file state management (PROCESSING, ACTIVE, FAILED)
- Add scheduled task for automatic expired file cleanup
- Integrate seamlessly with existing key management and load balancing
This commit is contained in:
cxyfer
2025-07-12 03:33:08 +08:00
parent b3da021803
commit 5eb2dfd822
16 changed files with 1549 additions and 7 deletions

View File

@@ -7,7 +7,7 @@ from sqlalchemy import inspect
from sqlalchemy.orm import Session
from app.database.connection import engine, Base
from app.database.models import Settings
from app.database.models import Settings, FileRecord
from app.log.logger import get_database_logger
logger = get_database_logger()