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:
@@ -49,7 +49,7 @@ final class DbnDiscrepancyAgent
|
||||
array $sliceSelection,
|
||||
?callable $emit = null
|
||||
): array {
|
||||
$engine = in_array($engine, ['azure_mini', 'azure_full', 'gpu'], true) ? $engine : 'azure_mini';
|
||||
$engine = in_array($engine, ['azure_mini', 'azure_full', 'gpu', 'claude_haiku', 'claude_sonnet'], true) ? $engine : 'azure_mini';
|
||||
$language = dbnToolsNormalizeUiLanguage($language);
|
||||
|
||||
$textA = mb_substr((string)($fileA['text'] ?? ''), 0, self::MAX_DOC_CHARS, 'UTF-8');
|
||||
@@ -754,11 +754,11 @@ PROMPT;
|
||||
): array {
|
||||
$locale = dbnToolsLanguageName($language);
|
||||
$sourceCount = count($numberedSources);
|
||||
$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,
|
||||
};
|
||||
|
||||
if (empty($numberedSources)) {
|
||||
@@ -872,10 +872,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