Timeline: group same-date/actor events, clean badges, Bedrock routing

- renderTimeline(): group consecutive same-date+actor events into one card
  with a bullet list; single events keep their current layout
- Date format: YYYY-MM-DD → "1 Jun 2023" (3-letter month, international)
- Time shown in header when available
- Remove date_type badge; confidence badge replaced by amber ⚠ flag on
  low-confidence events only (high/medium border colour still shows)
- LegalTools.php: resolve azure_full/azure_mini to Bedrock Sonnet/Haiku
  when DbnBedrockGateway is active; claude_sonnet/claude_haiku also handled
- timeline.php + api/timeline.php: engine labels updated (Claude Haiku/Sonnet);
  claude_haiku + claude_sonnet added to valid engine list
- i18n engine labels updated in all 4 languages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 23:21:35 +02:00
parent 25c2cf826d
commit 234ab7278b
5 changed files with 130 additions and 44 deletions
+19 -7
View File
@@ -506,18 +506,25 @@ PROMPT;
['role' => 'system', 'content' => $system],
['role' => 'user', 'content' => $prompt],
];
$maxTokens = match ($engine) { 'azure_full' => 8000, 'nova_lite' => 2000, default => 4000 };
$isBedrock = $this->azure instanceof DbnBedrockGateway;
$maxTokens = match ($engine) { 'azure_full', 'claude_sonnet' => 8000, 'nova_lite' => 2000, default => 4000 };
$chatOptions = ['json' => true, 'temperature' => 0.1, 'max_tokens' => $maxTokens, 'timeout' => 120];
$deployLabel = match ($engine) { 'azure_full' => 'gpt-4o', 'nova_lite' => 'nova-lite', default => 'gpt-4o-mini' };
$deployLabel = match (true) {
$engine === 'nova_lite' => 'nova-lite',
$engine === 'azure_full' || $engine === 'claude_sonnet' => $isBedrock ? 'claude-sonnet-bedrock' : 'gpt-4o',
default => $isBedrock ? 'claude-haiku-bedrock' : 'gpt-4o-mini',
};
$onProgress && $onProgress("Calling {$deployLabel}\u{2026}");
try {
if ($engine === 'nova_lite') {
$response = dbnToolsCallGpuLlm($messages, ['model' => 'nova-lite', 'max_tokens' => $maxTokens, 'temperature' => 0.1, 'timeout' => 120]);
} elseif ($engine === 'azure_full') {
$response = $this->azure->withDeployment('gpt-4o')->chat($messages, $chatOptions);
} elseif ($engine === 'azure_full' || $engine === 'claude_sonnet') {
$deploy = $isBedrock ? DbnBedrockModelRouter::LITELLM_SONNET : 'gpt-4o';
$response = $this->azure->withDeployment($deploy)->chat($messages, $chatOptions);
} else {
$response = $this->azure->withDeployment('gpt-4o-mini')->chat($messages, $chatOptions);
$deploy = $isBedrock ? DbnBedrockModelRouter::LITELLM_HAIKU : 'gpt-4o-mini';
$response = $this->azure->withDeployment($deploy)->chat($messages, $chatOptions);
}
} catch (Throwable $e) {
$msg = $e->getMessage();
@@ -570,7 +577,7 @@ PROMPT;
$events = array_values(array_filter($events, fn($ev) => ($ev['date_type'] ?? 'absolute') === 'absolute'));
}
$engineLabel = match ($engine) { 'azure_full' => 'gpt-4o', 'nova_lite' => 'nova-lite', default => 'gpt-4o-mini' };
$engineLabel = $deployLabel;
$focusLabel = match ($focus) {
'deadlines' => 'legal deadlines',
@@ -620,7 +627,12 @@ PROMPT;
?callable $onProgress,
int $inputDateHintCount
): array {
$engineLabel = match ($engine) { 'azure_full' => 'gpt-4o', 'nova_lite' => 'nova-lite', default => 'gpt-4o-mini' };
$isBedrock = $this->azure instanceof DbnBedrockGateway;
$engineLabel = match (true) {
$engine === 'nova_lite' => 'nova-lite',
$engine === 'azure_full' || $engine === 'claude_sonnet' => $isBedrock ? 'claude-sonnet-bedrock' : 'gpt-4o',
default => $isBedrock ? 'claude-haiku-bedrock' : 'gpt-4o-mini',
};
$chunkSize = $this->timelineChunkSize($engine);
$chunks = $this->timelineTextChunks($text, $chunkSize, 900);
$chunkCount = count($chunks);