Package ai.tabforge.workshop.agents
Class DefaultSubAgent
java.lang.Object
ai.tabforge.workshop.agent.SubAgent
ai.tabforge.workshop.agents.DefaultSubAgent
- Direct Known Subclasses:
ArchitectureCheckerAgent,PerformanceAnalystAgent,SecurityAuditorAgent,TransactionAnalystAgent
Base class for all agents.
Each agent will have the same analyzeFile() method. This class exists just for that.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultSubAgent(ProgressReporter orchestrator, com.anthropic.client.AnthropicClient client) -
Method Summary
Modifier and TypeMethodDescriptionprotected AgentResultanalyzeFile(String prompt, String fileContent, int maxOutputTokens) What is MessageCreateParams: It is a builder that builds the HTTP request body.Methods inherited from class ai.tabforge.workshop.agent.SubAgent
buildPrompt, execute, getAgentName
-
Constructor Details
-
DefaultSubAgent
protected DefaultSubAgent(ProgressReporter orchestrator, com.anthropic.client.AnthropicClient client) - Parameters:
orchestrator-client- : AnthropicClient is thread-safe — a single instance can be shared between all agents. That's why OrchestratorAgent makes one instance and injects it everywhere. There is no need to create a new client for each agent.
-
-
Method Details
-
analyzeFile
What is MessageCreateParams: It is a builder that builds the HTTP request body. Everything you put in the builder goes into JSON that is sent to the API:{ "model": "claude-haiku-4-5-...", "max_tokens": 4096, "system": "You are a security auditor...", "messages": [{ "role": "user", "content": "...Java code..." }] }- Specified by:
analyzeFilein classSubAgent- Parameters:
prompt-fileContent-- Returns:
-