diff --git a/advocate.php b/advocate.php index 4049f9c..6171ebd 100644 --- a/advocate.php +++ b/advocate.php @@ -52,13 +52,13 @@ require_once __DIR__ . '/includes/layout.php';
Engine - + - +
-

Azure mini finishes fastest. Claude Sonnet 4.6 via AWS Bedrock produces the most thorough advocate brief — superior at multi-party legal reasoning, ECHR precedent weighting, and long-form argumentation. Norwegian specialist v3 is a Qwen2.5 fine-tune trained on barnevernsloven, ECHR, and forvaltningsloven — highest precision for § 4-25, Strand Lobben, and procedural red flags.

+

Claude Haiku 4.5 is fast and accurate for most cases. Claude Sonnet 4.6 produces the most thorough advocate brief — superior at multi-party legal reasoning, ECHR precedent weighting, and long-form argumentation. Norwegian specialist v3 is a Qwen2.5 fine-tune trained on barnevernsloven, ECHR, and forvaltningsloven — highest precision for § 4-25, Strand Lobben, and procedural red flags.

Corpus slices

diff --git a/includes/DeepResearchAgent.php b/includes/DeepResearchAgent.php index e5db729..eab2f5f 100644 --- a/includes/DeepResearchAgent.php +++ b/includes/DeepResearchAgent.php @@ -501,8 +501,11 @@ PROMPT; ]); $raw = (string)($resp['choices'][0]['message']['content'] ?? ''); } else { - $raw = $this->azure->chatText([$sysMsg, $userMsg], - ['json' => true, 'temperature' => 0.1, 'max_tokens' => 500, 'timeout' => 30]); + $interpGateway = ($this->azure instanceof DbnBedrockGateway) + ? $this->azure->withDeployment(DbnBedrockModelRouter::LITELLM_HAIKU) + : $this->azure; + $raw = $interpGateway->chatText([$sysMsg, $userMsg], + ['json' => true, 'temperature' => 0.1, 'max_tokens' => 500, 'timeout' => 60]); } $json = $this->azure->decodeJsonObject($raw); if (is_array($json) && !empty($json['brief'])) { @@ -532,6 +535,10 @@ PROMPT; ? "\nKey retrieval anchors (incorporate these terms into your sub-questions where relevant):\n" . implode(', ', $keySignals) . "\n" : ''; + // Truncate seed to 2000 chars — $brief already captures the key context; + // the full upload text (up to 192K chars) would push past the 60s timeout. + $seedExcerpt = mb_strimwidth($seedDescription, 0, 2000, '…', 'UTF-8'); + if ($advocateRole !== '') { $prompt = <<azure->chatText([$sysMsg, $userMsg], - ['json' => true, 'temperature' => 0.2, 'max_tokens' => 700, 'timeout' => 35]); + $expGateway = ($this->azure instanceof DbnBedrockGateway) + ? $this->azure->withDeployment(DbnBedrockModelRouter::LITELLM_HAIKU) + : $this->azure; + $raw = $expGateway->chatText([$sysMsg, $userMsg], + ['json' => true, 'temperature' => 0.2, 'max_tokens' => 700, 'timeout' => 60]); } $json = $this->azure->decodeJsonObject($raw); $items = is_array($json['sub_questions'] ?? null) ? $json['sub_questions'] : []; @@ -1142,6 +1152,12 @@ PROMPT; } elseif ($engine === 'azure_full') { $raw = $this->azure->withDeployment('gpt-4o')->chatText($messages, $opts); $deployLabel = 'gpt-4o'; + } elseif ($engine === 'azure_mini' && $this->azure instanceof DbnBedrockGateway) { + // When Bedrock enabled, azure_mini → Haiku (fast, ~20-40s synthesis) + $haiku = $this->azure->withDeployment(DbnBedrockModelRouter::LITELLM_HAIKU); + $raw = $haiku->chatText($messages, array_merge($opts, ['max_tokens' => 2500, 'timeout' => 90])); + $deployLabel = 'Claude Haiku 4.5 (AWS Bedrock)'; + $thinkingTrace = null; } elseif ($engine === 'claude_sonnet' || ($this->azure instanceof DbnBedrockGateway)) { if ( $this->azure instanceof DbnBedrockGateway