mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
chatbot improvements
This commit is contained in:
@@ -75,14 +75,9 @@ public class SpiceSumarizer {
|
||||
sb.append(" ");
|
||||
}
|
||||
|
||||
String comment = outputComponentValue(c, sb);
|
||||
outputComponentValue(c, sb);
|
||||
|
||||
if (c instanceof ISpiceMapper) {
|
||||
String spiceComment = ((ISpiceMapper)c).getComment();
|
||||
if (spiceComment != null)
|
||||
comment += spiceComment;
|
||||
}
|
||||
sb.append(" ; ").append(comment);
|
||||
outputComment(c, sb);
|
||||
if (useHTML)
|
||||
sb.append("<br>");
|
||||
lines.add(sb.toString());
|
||||
@@ -94,7 +89,20 @@ public class SpiceSumarizer {
|
||||
.collect(Collectors.joining("\n"));
|
||||
}
|
||||
|
||||
private static String outputComponentValue(IDIYComponent<?> c, StringBuilder sb) {
|
||||
private static void outputComment(IDIYComponent<?> c, StringBuilder sb) {
|
||||
ComponentType componentType = ComponentProcessor.getInstance()
|
||||
.extractComponentTypeFrom((Class<? extends IDIYComponent<?>>) c.getClass());
|
||||
|
||||
String comment = componentType.getName() + " [" + componentType.getCategory() + "]";
|
||||
if (c instanceof ISpiceMapper) {
|
||||
String spiceComment = ((ISpiceMapper) c).getComment();
|
||||
if (spiceComment != null)
|
||||
comment = spiceComment + " " + comment;
|
||||
}
|
||||
sb.append(" ; ").append(comment);
|
||||
}
|
||||
|
||||
private static void outputComponentValue(IDIYComponent<?> c, StringBuilder sb) {
|
||||
ComponentType componentType = ComponentProcessor.getInstance()
|
||||
.extractComponentTypeFrom((Class<? extends IDIYComponent<?>>) c.getClass());
|
||||
|
||||
@@ -117,7 +125,6 @@ public class SpiceSumarizer {
|
||||
sb.append(c.getValue());
|
||||
}
|
||||
}
|
||||
return componentType.getName() + " [" + componentType.getCategory() + "]";
|
||||
}
|
||||
|
||||
private static String formatSpiceNode(int i) {
|
||||
|
||||
+1
-1
@@ -161,7 +161,7 @@ public class ChatbotService {
|
||||
if (!netlist.getSwitchSetup().isEmpty()) {
|
||||
sb.append("Switch configuration: ").append(netlist.getSwitchSetup()).append(". ");
|
||||
}
|
||||
sb.append("Effective circuit netlist")
|
||||
sb.append("Circuit netlist")
|
||||
.append(netlist.getSwitchSetup().isEmpty() ? "" : " in this switch configuration")
|
||||
.append(":\n\n");
|
||||
try {
|
||||
|
||||
@@ -293,7 +293,7 @@ public class ChatbotPane extends JPanel {
|
||||
|
||||
public JButton getAskButton() {
|
||||
if (askButton == null) {
|
||||
askButton = new JButton("Ask");
|
||||
askButton = new JButton("<html>Send ⏎</html>");
|
||||
askButton.setBackground(TERMINAL_BG);
|
||||
askButton.setForeground(TERMINAL_FG);
|
||||
askButton.setFocusPainted(false);
|
||||
|
||||
@@ -254,4 +254,5 @@ INSERT INTO diylc_knowledge_base(category, section, content) VALUES ('User Manua
|
||||
- If you are asking about a DIYLC feature, make sure to include the words "DIYLC" or "DIY Layout Creator" and the feature in question to ensure that the AI assistant understands the context of the question.
|
||||
- Use simple language and avoid complex technical terms.
|
||||
- Ask follow-up questions if needed.
|
||||
- Use the "Clear" button to reset the conversation.');
|
||||
- Use the "Clear" button to reset the conversation.
|
||||
- Each chat conversation is associated with the current project and is saved in the cloud and will be automatically downloaded when that project is opened.');
|
||||
Reference in New Issue
Block a user