feat(tools): DB-backed LLM engine admin (owner-only)
Add an owner-gated dashboard to remap any tool/tier's model live without a code push. Overrides live in dbn_tool_engine_config (dobetternorge_maindb) and are consulted by dbnToolsResolveToolRun() + dbnToolsReviewerModel(); no row = unchanged code/.env behaviour (fully back-compatible). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -91,6 +91,22 @@ final class ToolModels
|
||||
return self::QUALITY_TIERS[self::qualityTier($tier)]['engine'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Engine keys the gateway layer can route for the tier/legacy tools. This is the
|
||||
* allowlist an operator override (dbn_tool_engine_config) is validated against, so a
|
||||
* bad DB value can never produce an unroutable engine string.
|
||||
*/
|
||||
public static function tierEngineKeys(): array
|
||||
{
|
||||
return ['nova_lite', 'azure_mini', 'azure_full', 'gpu', 'regex', 'claude_haiku', 'claude_sonnet'];
|
||||
}
|
||||
|
||||
/** True if $engine is a routable tier/legacy engine key. */
|
||||
public static function isValidTierEngine(string $engine): bool
|
||||
{
|
||||
return in_array($engine, self::tierEngineKeys(), true);
|
||||
}
|
||||
|
||||
/** Human label for a quality tier (UI / telemetry). */
|
||||
public static function tierLabel(string $tier): string
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user