Maybe we fixed bugs?

This commit is contained in:
Mahesh Kommareddi 2024-07-17 00:15:07 -04:00
parent be0ed8f22d
commit b91631f562
5 changed files with 22 additions and 8 deletions

View File

@ -49,7 +49,7 @@ const TreeOfThoughtVisual = ({ data }) => {
}, [data]);
return <svg ref={svgRef} width="800" height="600" />;
return <svg ref={svgRef} width="1920" height="1080" />;
};
export default TreeOfThoughtVisual;

View File

@ -20,4 +20,9 @@ public class AgentInfo {
public List<String> getCapabilities() {
return this.capabilities;
}
@Override
public String toString() {
return "AgentInfo{id='" + id + "', name='" + name + "'}";
}
}

View File

@ -63,18 +63,20 @@ public class TeamFormation {
String[] lines = reasoning.split("\n");
String selectedTeamLine = "";
for (String line : lines) {
if (line.startsWith("Final Team Selection:")) {
selectedTeamLine = line.substring("Final Team Selection:".length()).trim();
if (line.toLowerCase().contains("final team selection")) {
selectedTeamLine = line.substring(line.indexOf(":") + 1).trim();
break;
}
}
System.out.println("DEBUG: Selected team line: " + selectedTeamLine);
if (selectedTeamLine.isEmpty()) {
System.out.println("DEBUG: No team selection found in the response.");
return List.of();
}
List<String> selectedIds = Arrays.asList(selectedTeamLine.split(",\\s*"));
List<String> selectedIds = Arrays.asList(selectedTeamLine.split("[,\\s]+"));
System.out.println("DEBUG: Parsed agent IDs: " + selectedIds);
List<AgentInfo> team = potentialAgents.stream()
@ -82,6 +84,13 @@ public class TeamFormation {
.collect(Collectors.toList());
System.out.println("DEBUG: Final team: " + team);
if (team.isEmpty() && !selectedIds.isEmpty()) {
// If no agents were matched but we did find IDs, add the first potential agent as a fallback
team = potentialAgents.stream().limit(1).collect(Collectors.toList());
System.out.println("DEBUG: No agents matched IDs. Using fallback: " + team);
}
return team;
}
}