fix(tools): route quick/pro tiers to Haiku/Sonnet on Bedrock
Tier engine strings (claude_haiku/claude_sonnet) were stripped back to azure_mini by per-method whitelists, so both tiers ran gpt-4o-mini and Pro charged 2x for the same model. Add a shared DbnBedrockModelRouter:: deploymentForEngine() helper and route the cloud path through it across summarize, ask, barnevernet, discrepancy, deep-research, and korrespond. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -75,7 +75,7 @@ final class DbnBvjAnalyzerAgent
|
||||
string $additionalNotes = '',
|
||||
?callable $emit = null
|
||||
): array {
|
||||
$engine = in_array($engine, ['azure_mini', 'azure_full', 'gpu'], true)
|
||||
$engine = in_array($engine, ['azure_mini', 'azure_full', 'gpu', 'claude_haiku', 'claude_sonnet'], true)
|
||||
? $engine : 'azure_mini';
|
||||
$language = dbnToolsNormalizeUiLanguage($language);
|
||||
$controls = $this->normalizeControls($controls);
|
||||
@@ -941,11 +941,11 @@ PROMPT;
|
||||
];
|
||||
$opts = ['json' => true, 'temperature' => $temperature, 'max_tokens' => 4500, 'timeout' => 240];
|
||||
|
||||
$cloudDeploy = DbnBedrockModelRouter::deploymentForEngine($engine, $this->azure instanceof DbnBedrockGateway);
|
||||
$deployLabel = match ($engine) {
|
||||
'gpu' => 'GPU (cuttlefish)',
|
||||
'dbn_legal_v3' => 'dbn-legal-agent-v3',
|
||||
'azure_full' => 'gpt-4o',
|
||||
default => $this->azure->chatDeployment(),
|
||||
default => $cloudDeploy,
|
||||
};
|
||||
|
||||
$raw = '';
|
||||
@@ -956,10 +956,8 @@ PROMPT;
|
||||
} elseif ($engine === 'gpu') {
|
||||
$response = dbnToolsCallGpuLlm($messages, $opts);
|
||||
$raw = (string)($response['choices'][0]['message']['content'] ?? '');
|
||||
} elseif ($engine === 'azure_full') {
|
||||
$raw = $this->azure->withDeployment('gpt-4o')->chatText($messages, $opts);
|
||||
} else {
|
||||
$raw = $this->azure->chatText($messages, $opts);
|
||||
$raw = $this->azure->withDeployment($cloudDeploy)->chatText($messages, $opts);
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
dbnToolsAbort('Synthesis LLM request failed: ' . $e->getMessage(), 502, 'llm_error');
|
||||
|
||||
Reference in New Issue
Block a user