refactor: update CoreMemory to v2 and rename OllamaToolResponse
build / build (push) Has been cancelled

- Refactored `CoreMemory` to support versioning (v2) and dual-memory types: `MAPPED_MEMORY` (key-value) and `ARRAYED_MEMORY` (sequential).
- Added automatic migration logic for v1 memory files to v2.
- Introduced new memory tools: `AddArrayMemory`, `GetArrayMemory`, and `GetArrayedMemories`.
- Renamed `OllamaToolRespnce` to `OllamaToolResponse` and added `empty()` factory methods for better error handling.
- Updated multiple function tools (e.g., `GetMemoryFunction`, `GetMemoriesFunction`, `APITool`, `GetWikiPageText`) to use the new `OllamaToolResponse` and `Optional`-based memory retrieval.
- Improved null safety by adding `@NotNull` annotations to tool implementations.
This commit is contained in:
2026-05-27 21:10:15 +02:00
parent ac159c2498
commit 931c274cd3
27 changed files with 331 additions and 113 deletions
@@ -283,10 +283,10 @@ public class PythonRunner extends OllamaFunctionTool {
}
@Override
public OllamaToolRespnce function(OllamaFunctionArgument... args) {
public @NonNull OllamaToolResponse function(OllamaFunctionArgument... args) {
if(dockerClient == null)
{
return new OllamaToolRespnce(name(), "Docker is disabled");
return new OllamaToolResponse(name(), "Docker is disabled");
}
if(args.length == 0)
{
@@ -442,7 +442,7 @@ public class PythonRunner extends OllamaFunctionTool {
dockerClient.removeContainerCmd(containerId).exec();
return new OllamaToolRespnce(name(), output.isEmpty() ? "Code ran successfully with no output" : output);
return new OllamaToolResponse(name(), output.isEmpty() ? "Code ran successfully with no output" : output);
}
catch (Exception e) {
throw new OllamaToolErrorException(name(), "Docker unavailable");