refactor: update CoreMemory to v2 and rename OllamaToolResponse
build / build (push) Has been cancelled
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:
@@ -4,7 +4,7 @@ import io.github.fastily.jwiki.core.Wiki;
|
||||
import me.zacharias.chat.ollama.OllamaFunctionArgument;
|
||||
import me.zacharias.chat.ollama.OllamaFunctionTool;
|
||||
import me.zacharias.chat.ollama.OllamaPerameter;
|
||||
import me.zacharias.chat.ollama.OllamaToolRespnce;
|
||||
import me.zacharias.chat.ollama.OllamaToolResponse;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class GetWikiPageText extends OllamaFunctionTool {
|
||||
@@ -28,7 +28,7 @@ public class GetWikiPageText extends OllamaFunctionTool {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OllamaToolRespnce function(OllamaFunctionArgument... args) {
|
||||
return new OllamaToolRespnce(name(), wiki.getPageText((String) args[0].value()));
|
||||
public @NotNull OllamaToolResponse function(OllamaFunctionArgument... args) {
|
||||
return new OllamaToolResponse(name(), wiki.getPageText((String) args[0].value()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user