Fix legal analysis issue extraction for long documents
This commit is contained in:
@@ -118,6 +118,14 @@ try {
|
||||
$emit('progress', ['step' => 'synthesising', 'detail' => 'Synthesising overall assessment…']);
|
||||
$synth = $agent->synthesise($answered, $language, $docType);
|
||||
|
||||
$legalCheck = [];
|
||||
try {
|
||||
$legalCheck = dbnToolsRunLegalCheck(
|
||||
mb_strimwidth((string)($synth['overall_assessment'] ?? ''), 0, 800),
|
||||
$docType
|
||||
);
|
||||
} catch (Throwable) {}
|
||||
|
||||
$result = [
|
||||
'ok' => true,
|
||||
'issues' => $answered,
|
||||
@@ -126,6 +134,7 @@ try {
|
||||
'disclaimer' => $synth['disclaimer'],
|
||||
'doc_type' => $docType,
|
||||
'model' => 'dbn-legal-agent-v3',
|
||||
'legal_check' => $legalCheck,
|
||||
'latency_ms' => (int)round((microtime(true) - $startTime) * 1000),
|
||||
];
|
||||
if ($ftRemaining >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user