diff options
Diffstat (limited to 'Omni/Agent/Worker.hs')
| -rw-r--r-- | Omni/Agent/Worker.hs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs index dafd0b2..aa7c5ab 100644 --- a/Omni/Agent/Worker.hs +++ b/Omni/Agent/Worker.hs @@ -465,10 +465,20 @@ buildRetryPrompt (Just ctx) = <> "- If there were merge conflicts, the conflicting files may have been modified by others\n" <> "- Review the current state of those files before making changes\n" --- | Select model based on task complexity --- Currently always uses claude-sonnet-4, but can be extended for model selection +-- | Select model based on task complexity (1-5 scale) +-- Uses OpenRouter model identifiers for Claude models selectModel :: TaskCore.Task -> Text -selectModel _ = "anthropic/claude-sonnet-4-20250514" +selectModel task = selectModelByComplexity (TaskCore.taskComplexity task) + +-- | Select model based on complexity level +selectModelByComplexity :: Maybe Int -> Text +selectModelByComplexity Nothing = "anthropic/claude-sonnet-4-20250514" +selectModelByComplexity (Just 1) = "anthropic/claude-haiku" +selectModelByComplexity (Just 2) = "anthropic/claude-haiku" +selectModelByComplexity (Just 3) = "anthropic/claude-sonnet-4-20250514" +selectModelByComplexity (Just 4) = "anthropic/claude-sonnet-4-20250514" +selectModelByComplexity (Just 5) = "anthropic/claude-opus-4-20250514" +selectModelByComplexity (Just _) = "anthropic/claude-sonnet-4-20250514" formatTask :: TaskCore.Task -> Text formatTask t = |
