Package net.thevpc.naru.impl.engine
Class NaruAgentImpl
java.lang.Object
net.thevpc.naru.impl.engine.NaruAgentImpl
- All Implemented Interfaces:
NaruAgent
The core agent loop.
- Adds a system prompt + user task to the conversation history.
- Calls the model.
- If the model returns
tool_calls: dispatches each call viaNaruRegistry, appends the results, and loops. - If the model returns plain text: that is the final answer.
- Stops after
maxStepsiterations regardless.
This class is pure Java — no Nuts dependency — so it can be extracted into a standalone library later.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionenv()net.thevpc.nuts.io.NPathvoidlog(NaruLogMode mode, net.thevpc.nuts.text.NMsg message) logger(net.thevpc.nuts.log.NLogger logger) newSession(net.thevpc.nuts.io.NPath dir) <T> Future<T>postAction(net.thevpc.nuts.concurrent.NCallable<T> action) setProjectDirectory(net.thevpc.nuts.io.NPath projectDirectory) startInteractiveSession(String... commands) startSession(String... commands)
-
Constructor Details
-
NaruAgentImpl
public NaruAgentImpl()
-
-
Method Details
-
postAction
-
getProjectDirectory
public net.thevpc.nuts.io.NPath getProjectDirectory()- Specified by:
getProjectDirectoryin interfaceNaruAgent
-
setProjectDirectory
- Specified by:
setProjectDirectoryin interfaceNaruAgent
-
env
-
getModelAliases
-
logger
-
startInteractiveSession
- Specified by:
startInteractiveSessionin interfaceNaruAgent
-
newSession
-
startSession
- Specified by:
startSessionin interfaceNaruAgent
-
log
-