feat: add config-driven AI model tier routing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,27 @@ class Settings(BaseSettings):
|
||||
AI_MODEL_GEMINI: str = "gemini-2.5-flash"
|
||||
AI_MODEL_ANTHROPIC: str = "claude-sonnet-4-6"
|
||||
|
||||
# Model tier routing — maps action types to model tiers
|
||||
AI_MODEL_TIERS: dict[str, str] = {
|
||||
"fast": "claude-haiku-4-5-20251001",
|
||||
"standard": "claude-sonnet-4-6-20250514",
|
||||
}
|
||||
|
||||
ACTION_MODEL_MAP: dict[str, str] = {
|
||||
"generate_full": "standard",
|
||||
"generate_branch": "standard",
|
||||
"modify_node": "fast",
|
||||
"add_steps": "standard",
|
||||
"quick_action": "fast",
|
||||
"open_chat": "standard",
|
||||
"variable_inference": "fast",
|
||||
}
|
||||
|
||||
def get_model_for_action(self, action_type: str) -> str:
|
||||
"""Resolve an action type to a concrete model name via tier routing."""
|
||||
tier = self.ACTION_MODEL_MAP.get(action_type, "standard")
|
||||
return self.AI_MODEL_TIERS.get(tier, self.AI_MODEL_TIERS["standard"])
|
||||
|
||||
# MCP (Model Context Protocol) integrations
|
||||
ENABLE_MCP_MICROSOFT_LEARN: bool = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user