Refactor BaseAgent

This commit is contained in:
extio-de
2025-06-27 10:25:54 +02:00
parent 38138b177b
commit dcd6eeee41
6 changed files with 90 additions and 44 deletions

View File

@@ -62,7 +62,7 @@ public class AgentTest {
AgentType.CONVERSATION,
ModelCategory.MEDIUM,
"",
"Generate a list of 5 distinct features. Provide no preamble and no explanation. Return the response in JSON format with the following field: { \"features\": [\"Feature 1\", \"Feature 2\", ... ] }",
"Generate a list of 5 distinct functional features. In scope is business logic, not code mechanics. Provide no preamble and no explanation. Return the response in JSON format with the following field: { \"features\": [\"Feature 1\", \"Feature 2\", ... ] }",
new JsonAgentResponseHandler(),
null,
context -> context.getContext().get("features").forEach(feature -> LOGGER.info(feature.toString())),
@@ -103,7 +103,7 @@ public class AgentTest {
context -> AgentNext.END));
final var context = new AgentContext(agents);
context.getContext().put("code", List.of(Files.readString(Path.of("src/main/java/de/extio/lmlib/agent/Agent.java"))));
context.getContext().put("code", List.of(Files.readString(Path.of("src/main/java/de/extio/lmlib/agent/BaseAgent.java"))));
final var resultContexts = this.agentExecutor.walkGraph(agents.get("CodeSummarizer"), context);