feat: Freelancer Match — полная продакшн версия с AI-матчингом и escrow

This commit is contained in:
root
2026-07-03 12:12:43 +00:00
commit ec2e9bf508
37 changed files with 1564 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
"""AI endpoints: матчинг, рекомендации."""
import logging
from fastapi import APIRouter, Depends
from sqlalchemy.ext.asyncio import AsyncSession
from app.core.database import get_db
from app.schemas.ai_match import AIMatchRequest, AIMatchResponse
from app.services.ai_service import find_matches
logger = logging.getLogger(__name__)
router = APIRouter(prefix="/api/ai", tags=["ai"])
@router.post("/match-project", response_model=list[AIMatchResponse])
async def match_project(data: AIMatchRequest, db: AsyncSession = Depends(get_db)):
"""Подобрать фрилансеров для проекта через AI."""
matches = await find_matches(
db=db, project_id=data.project_id, limit=data.limit, min_score=data.min_score
)
return [AIMatchResponse(**m) for m in matches]
@router.post("/generate-cover-letter")
async def generate_cover_letter(project_title: str, freelancer_skills: list[str]):
"""Сгенерировать сопроводительное письмо для заявки."""
# Placeholder — в продакшене вызов LLM
return {
"cover_letter": f"Здравствуйте! Я заинтересован в проекте '{project_title}'. Мой опыт работы с [{', '.join(freelancer_skills)}] позволяет качественно выполнить задачу."
}