feat: pass temporal_mode and as_of_date through DBN search API

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-12 18:45:54 +02:00
parent 1f4f01bda3
commit 3c8d7ebc34
2 changed files with 45 additions and 15 deletions
+9 -3
View File
@@ -9,7 +9,13 @@ $input = dbnToolsJsonInput(12000);
$language = dbnToolsNormalizeLanguage($input['language'] ?? 'en');
dbnToolsWithTelemetry('search', $language, function () use ($input, $language): array {
$query = dbnToolsString($input, 'query', 2000);
$limit = max(1, min(10, (int)($input['limit'] ?? 6)));
return (new DbnLegalToolsService())->search($query, $language, $limit);
$query = dbnToolsString($input, 'query', 2000);
$limit = max(1, min(10, (int)($input['limit'] ?? 6)));
$temporalMode = in_array($input['temporal_mode'] ?? '', ['legal_conservative', 'disabled'], true)
? $input['temporal_mode']
: 'disabled';
$asOfDate = isset($input['as_of_date']) && preg_match('/^\d{4}(-\d{2}(-\d{2})?)?$/', $input['as_of_date'])
? $input['as_of_date']
: null;
return (new DbnLegalToolsService())->search($query, $language, $limit, $temporalMode, $asOfDate);
});