From ba238484a67ec4cf54d2a7f7054606677c5913e5 Mon Sep 17 00:00:00 2001 From: supertick Date: Tue, 18 Jun 2024 06:24:47 -0700 Subject: [PATCH] llm clear history --- src/main/java/org/myrobotlab/service/LLM.java | 6 ++++-- src/main/resources/resource/WebGui/app/service/js/LLMGui.js | 4 ++++ .../resources/resource/WebGui/app/service/views/LLMGui.html | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/myrobotlab/service/LLM.java b/src/main/java/org/myrobotlab/service/LLM.java index 032e8c1528..3aada69b49 100644 --- a/src/main/java/org/myrobotlab/service/LLM.java +++ b/src/main/java/org/myrobotlab/service/LLM.java @@ -1,9 +1,7 @@ package org.myrobotlab.service; import java.io.IOException; -import java.time.LocalDate; import java.time.LocalDateTime; -import java.time.LocalTime; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -357,6 +355,10 @@ public void attach(Attachable attachable) { log.error("don't know how to attach a {}", attachable.getName()); } } + + public void clearHistory() { + userMessages.clear(); + } public static void main(String[] args) { try { diff --git a/src/main/resources/resource/WebGui/app/service/js/LLMGui.js b/src/main/resources/resource/WebGui/app/service/js/LLMGui.js index c5765b1979..587b3ba279 100644 --- a/src/main/resources/resource/WebGui/app/service/js/LLMGui.js +++ b/src/main/resources/resource/WebGui/app/service/js/LLMGui.js @@ -121,6 +121,10 @@ angular.module("mrlapp.service.LLMGui", []).controller("LLMGuiCtrl", [ msg.send("save") } + $scope.clearHistory = function () { + msg.send("clearHistory") + } + $scope.getResponse = function () { $scope.saveValues() msg.send("getResponse", $scope.text) diff --git a/src/main/resources/resource/WebGui/app/service/views/LLMGui.html b/src/main/resources/resource/WebGui/app/service/views/LLMGui.html index 306f35459f..acc03912a7 100644 --- a/src/main/resources/resource/WebGui/app/service/views/LLMGui.html +++ b/src/main/resources/resource/WebGui/app/service/views/LLMGui.html @@ -132,7 +132,9 @@ - + + +
You must save configuration to make it persistent.