Refactored to Core 1.10.0
This includes chages to make less things static in the Core, instead using the Options Singelton instead
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
package me.neurodock.display;
|
||||
|
||||
import me.neurodock.core.Core;
|
||||
import me.neurodock.core.Options;
|
||||
import me.neurodock.core.Pair;
|
||||
import me.neurodock.core.PrintMessageHandler;
|
||||
import me.neurodock.core.files.FileHandlerLocation;
|
||||
import me.neurodock.core.memory.CoreMemory;
|
||||
import me.neurodock.ollama.*;
|
||||
import me.neurodock.ollama.utils.SystemMessage;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
|
||||
import static me.neurodock.core.Core.writeLog;
|
||||
@@ -43,15 +44,17 @@ public class Display {
|
||||
public Display()
|
||||
{
|
||||
|
||||
Options.getInstance().setDataDir(Path.of("AI-Chat"), false);
|
||||
|
||||
core.setOllamaObject/*NoMemory*/(OllamaObject.builder()
|
||||
.setModel("llama3.1:8b")
|
||||
.keep_alive(10)
|
||||
//.stream(false)
|
||||
.addFileTools(FileHandlerLocation.DATA_FILES)
|
||||
.addFileTools(Options.getInstance().getFileHandlerDataLocation())
|
||||
.addMessages(new SystemMessage("You need to emulate feelings and emotions."))
|
||||
.build());
|
||||
|
||||
core.enablePlugins(Core.PLUGIN_DIRECTORY);
|
||||
core.enablePlugins(Options.getInstance().getPluginDirectory());
|
||||
|
||||
core.addTool(new TimeTool(), Core.Source.CTP);
|
||||
// TODO: Well Docker failes when luanched.... Fuck
|
||||
@@ -158,9 +161,9 @@ public class Display {
|
||||
break;
|
||||
case "working":
|
||||
System.out.println("Working directories:\n" +
|
||||
" Data: " + Core.DATA_DIR.getAbsolutePath() + "\n" +
|
||||
" DateFiles: " + FileHandlerLocation.DATA_FILES + "\n" +
|
||||
" Plugins: " + Core.PLUGIN_DIRECTORY.getAbsolutePath());
|
||||
" Data: " + Options.getInstance().getDataDir().getAbsolutePath() + "\n" +
|
||||
" DateFiles: " + Options.getInstance().getFileHandlerDataLocation() + "\n" +
|
||||
" Plugins: " + Options.getInstance().getPluginDirectory().getAbsolutePath());
|
||||
break;
|
||||
default:
|
||||
System.out.println("Unknown command: " + message);
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.github.dockerjava.core.DockerClientImpl;
|
||||
import com.github.dockerjava.httpclient5.ApacheDockerHttpClient;
|
||||
import com.github.dockerjava.transport.DockerHttpClient;
|
||||
import me.neurodock.core.Core;
|
||||
import me.neurodock.core.Options;
|
||||
import me.neurodock.core.Pair;
|
||||
import me.neurodock.ollama.OllamaFunctionArgument;
|
||||
import me.neurodock.ollama.OllamaFunctionTool;
|
||||
@@ -434,7 +435,7 @@ public class PythonRunner extends OllamaFunctionTool {
|
||||
fullCmd.append(arg).append(" ");
|
||||
}
|
||||
|
||||
File program = new File(Core.CACHE_DIRECTORY, "cmd.sh");
|
||||
File program = new File(Options.getInstance().getCacheDirectory(), "cmd.sh");
|
||||
if(program.exists()){
|
||||
program.delete();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user