7690ed17ee
Add 4-language switcher (EN/NO/UK/PL), engine choice (Azure mini/full, GPU/cuttlefish), and expandable Advanced panel (Focus, Confidence filter, Date types) to timeline.php. Wire new params through api/timeline.php and LegalTools::timeline() with engine routing, focus-aware prompt injection, and confidence/date-type post-filters. Add TIMELINE_I18N to tools.js with improved renderTimeline() confidence colour-coding and new CSS classes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
1.0 KiB
PHP
29 lines
1.0 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/../includes/LegalTools.php';
|
|
|
|
dbnToolsRequireMethod('POST');
|
|
dbnToolsRequireAuth();
|
|
$input = dbnToolsJsonInput(400000);
|
|
$language = dbnToolsNormalizeLanguage($input['language'] ?? 'en');
|
|
|
|
dbnToolsWithTelemetry('timeline', $language, function () use ($input, $language): array {
|
|
$text = dbnToolsString($input, 'text', 128000);
|
|
|
|
$validEngines = ['azure_mini', 'azure_full', 'gpu'];
|
|
$engine = in_array((string)($input['engine'] ?? ''), $validEngines, true)
|
|
? (string)$input['engine'] : 'azure_mini';
|
|
|
|
$validFocus = ['all', 'deadlines', 'hearings', 'cps'];
|
|
$focus = in_array((string)($input['focus'] ?? ''), $validFocus, true)
|
|
? (string)$input['focus'] : 'all';
|
|
|
|
$confidenceFilter = (string)($input['confidence_filter'] ?? '') === 'high_medium'
|
|
? 'high_medium' : 'all';
|
|
|
|
$includeRelative = ($input['include_relative'] ?? true) !== false;
|
|
|
|
return (new DbnLegalToolsService())->timeline($text, $language, $engine, $focus, $confidenceFilter, $includeRelative);
|
|
});
|