diff options
Diffstat (limited to 'internal/executor/classifier.go')
| -rw-r--r-- | internal/executor/classifier.go | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/internal/executor/classifier.go b/internal/executor/classifier.go index efd2acb..7a474b6 100644 --- a/internal/executor/classifier.go +++ b/internal/executor/classifier.go @@ -24,12 +24,10 @@ type Classifier struct { } const classificationPrompt = ` -You are a task classifier for Claudomator. -Given a task description and system status, select the best agent (claude or gemini) and model to use. +You are a model selector for Claudomator. +The agent has already been chosen by the load balancer. Your ONLY job is to select the best model for that agent. -Agent Types: -- claude: Best for complex coding, reasoning, and tool use. -- gemini: Best for large context, fast reasoning, and multimodal tasks. +REQUIRED agent: %s Available Models: Claude: @@ -38,38 +36,30 @@ Claude: - claude-haiku-4-5-20251001 (fast, cheap, use for simple tasks) Gemini: -- gemini-2.5-flash-lite (fastest, most efficient, best for simple tasks) +- gemini-2.5-flash-lite (fastest, most efficient, best for simple/trivial tasks) - gemini-2.5-flash (fast, balanced) -- gemini-2.5-pro (most powerful Gemini, larger context) +- gemini-2.5-pro (most powerful, use for hardest tasks only) Selection Criteria: -- Agent: CRITICAL: You MUST select an agent where "Rate Limited: false". DO NOT select an agent where "Rate Limited: true" if any other agent is available and NOT rate limited. - Check the "System Status" section below. If it says "- Agent claude: ... Rate Limited: true", you MUST NOT select claude. Use gemini instead. -- Model: Select based on task complexity. Use powerful models (opus, pro, pro-preview) for complex reasoning/coding, flash-lite/flash/haiku for simple tasks. +- Use powerful models (opus, pro) only for the hardest reasoning/coding tasks. +- Use lite/haiku for simple, short, or low-stakes tasks. +- Default to the balanced model (sonnet, flash) for everything else. Task: Name: %s Instructions: %s -System Status: -%s - Respond with ONLY a JSON object: { - "agent_type": "claude" | "gemini", + "agent_type": "%s", "model": "model-name", "reason": "brief reason" } ` -func (c *Classifier) Classify(ctx context.Context, taskName, instructions string, status SystemStatus) (*Classification, error) { - statusStr := "" - for agent, active := range status.ActiveTasks { - statusStr += fmt.Sprintf("- Agent %s: %d active tasks, Rate Limited: %t\n", agent, active, status.RateLimited[agent]) - } - +func (c *Classifier) Classify(ctx context.Context, taskName, instructions string, _ SystemStatus, agentType string) (*Classification, error) { prompt := fmt.Sprintf(classificationPrompt, - taskName, instructions, statusStr, + agentType, taskName, instructions, agentType, ) binary := c.GeminiBinaryPath |
