feat: use firm's own templates as style guide for AI-drafted petitions
Belge Şablonları uploads now also get extracted_text (same OCR/office pipeline as documents), and a new POST /api/drafting/generate builds a real AI draft from the case's actual data (title, UYAP parties, latest Dosya Özeti) — if the lawyer picks one of their own templates, its extracted text is passed as a style/format reference only (the prompt explicitly forbids copying the template's old case facts). Dilekçe Hazırlama no longer fakes a draft with setTimeout. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
50f6cbb1b2
commit
fa01432ffe
@@ -0,0 +1,9 @@
|
||||
import { Router } from 'express';
|
||||
import { requireAuth } from '../middleware/auth';
|
||||
import { generateDraft } from '../controllers/drafting.controller';
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.post('/generate', requireAuth, generateDraft);
|
||||
|
||||
export default router;
|
||||
@@ -4,6 +4,7 @@ import chatRoutes from './chat.routes';
|
||||
import precedentRoutes from './precedent.routes';
|
||||
import caseRoutes from './case.routes';
|
||||
import templateRoutes from './template.routes';
|
||||
import draftingRoutes from './drafting.routes';
|
||||
|
||||
const router = Router();
|
||||
|
||||
@@ -15,6 +16,7 @@ router.use('/documents', documentRoutes);
|
||||
router.use('/chat', chatRoutes);
|
||||
router.use('/cases', caseRoutes);
|
||||
router.use('/templates', templateRoutes);
|
||||
router.use('/drafting', draftingRoutes);
|
||||
router.use('/', precedentRoutes); // Keeps the same paths like /api/search-precedents
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user