Package net.thevpc.naru.api.registry
Class NaruDirectiveBase
java.lang.Object
net.thevpc.naru.api.registry.NaruDirectiveBase
- All Implemented Interfaces:
NaruDirective
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassstatic interfaceclass -
Constructor Summary
ConstructorsConstructorDescriptionNaruDirectiveBase(String name, String group, String description, String... aliases) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCandidates(List<NArgCompleteCandidate> candidates, String prefix, String... options) execute(NaruDirectiveCallContext context) Execute the tool and return a string result that will be sent back to the model as a "tool" role message.executeHelp(NaruDirectiveCallContext context, NCmdLine cmdLine) String[]Human-readable description sent to the model.group()name()Machine-readable name used in the tool schema (no spaces).protected voidresolveCandidates(NCmdLine cmdLine, NArgCompletePosition pos, NaruSession session) Resolve autocomplete candidates for this directive.protected NOptional<NaruDirectiveBase.SubCommand>subCommand(String name)
-
Constructor Details
-
NaruDirectiveBase
-
-
Method Details
-
noCommand
-
noCommand
-
register
-
subCommand
-
group
- Specified by:
groupin interfaceNaruDirective
-
getAliases
- Specified by:
getAliasesin interfaceNaruDirective
-
name
Description copied from interface:NaruDirectiveMachine-readable name used in the tool schema (no spaces).- Specified by:
namein interfaceNaruDirective
-
getDescription
Description copied from interface:NaruDirectiveHuman-readable description sent to the model.- Specified by:
getDescriptionin interfaceNaruDirective
-
addCandidates
protected void addCandidates(List<NArgCompleteCandidate> candidates, String prefix, String... options) -
execute
Description copied from interface:NaruDirectiveExecute the tool and return a string result that will be sent back to the model as a "tool" role message.- Specified by:
executein interfaceNaruDirective- Parameters:
context- per-run context (project dir, session, etc.)- Returns:
- result string (text, JSON snippet, error message, …)
-
executeHelp
-
resolveCandidates
public List<NArgCompleteCandidate> resolveCandidates(NCmdLine cmdLine, NArgCompletePosition pos, NaruSession session) Description copied from interface:NaruDirectiveResolve autocomplete candidates for this directive.- Specified by:
resolveCandidatesin interfaceNaruDirective
-