Well lot's in this

Some API modifications/additions

Starting the implementation of a local file system for the AI to use

Staring to try to migrate the ./cache, ./logs, ./messages, and ./pythonFiles to more appropiet locations depenidng on OS
This commit is contained in:
2025-03-25 23:25:29 +01:00
parent 01de196d82
commit 9b3c6c20b8
20 changed files with 568 additions and 174 deletions

View File

@@ -3,6 +3,8 @@ package me.zacharias.chat.display;
import me.zacharias.chat.core.Core;
import me.zacharias.chat.core.Pair;
import me.zacharias.chat.core.PrintMessageHandler;
import me.zacharias.chat.core.files.FileHandlerLocation;
import me.zacharias.chat.core.memory.CoreMemory;
import me.zacharias.chat.ollama.*;
import org.json.JSONObject;
@@ -45,10 +47,11 @@ public class Display {
//.setModel("deepseek-r1")
.keep_alive(10)
//.stream(false)
.addFileTools(FileHandlerLocation.DATA_FILES)
.build());
core.addTool(new TimeTool(), Core.Source.INTERNAL);
core.addTool(new PythonRunner(core), Core.Source.INTERNAL);
//core.addTool(new TimeTool(), Core.Source.INTERNAL);
//core.addTool(new PythonRunner(core), Core.Source.INTERNAL);
//core.getOllamaObject().addMessage(new OllamaMessage(OllamaMessageRole.SYSTEM, "Have a nice tone and use formal wording"));
@@ -100,6 +103,21 @@ public class Display {
case "write":
core.flushLog();
break;
case "peek":
CoreMemory coreMemory = CoreMemory.getInstance();
StringBuilder buffer = new StringBuilder("[");
ArrayList<String> memory = new ArrayList<>(coreMemory.getMemory());
for(int i = 0; i < memory.size(); i++) {
String mem = memory.get(i);
buffer.append("\"").append(mem).append("\"");
if(i+1 < memory.size()) {
buffer.append(", ");
}
}
buffer.append("]");
writeLog("Memory peek: "+buffer.toString());
System.out.println(buffer.toString());
break;
default:
System.out.println("Unknown command: " + message);
}