Class AiToolRegistry
java.lang.Object
com.kingsrook.qqq.backend.core.actions.ai.AiToolRegistry
- All Implemented Interfaces:
MetaDataProducerOutput,QMetaDataObject,QSupplementalInstanceMetaData,TopLevelMetaDataInterface,Serializable
Tools contributed to the AI tool kernel by qbits and applications.
A qbit registers typed tools here while it produces its meta-data; every
AiToolKernel built over the instance afterwards offers them next to the
built-in tools, and runs them through the same path: the caller's session
in QContext, strict input-key validation, the untrusted-data envelope,
redaction, outcome mapping (DENIED / NOT_FOUND / INVALID_INPUT / ERROR) and
the tool's own use of AiToolContext.prepareInput (core permission
enforcement and record security locks).
Only READ and NAVIGATION tools may be registered. The kernel has no
approval flow, so a WRITE_PROPOSAL tool is refused: a qbit that lets a model
propose changes runs those tools in its own, approval-aware runtime.
Contributed tool names must not collide with the built-in tools or each
other; registration refuses a duplicate, and the instance validator reports
a collision with a built-in name.
Not published to frontends: the v1 meta-data response only includes
supplemental instance meta-data it knows, and this class exposes no
frontend settings.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()getTools()The registered tools, by name (sorted, unmodifiable).static AiToolRegistryThe registry of an instance, or null if nothing was registered.static AiToolRegistryofOrWithNew(QInstance qInstance) The registry of an instance, creating (and adding) it if needed.voidvalidate(QInstance qInstance, QInstanceValidator validator) A contributed tool may not take a built-in tool's name.withTool(AbstractAiTool tool) Register a tool.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.kingsrook.qqq.backend.core.model.metadata.QSupplementalInstanceMetaData
addSelfToInstance, enrich
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
AiToolRegistry
public AiToolRegistry()
-
-
Method Details
-
of
The registry of an instance, or null if nothing was registered. -
ofOrWithNew
The registry of an instance, creating (and adding) it if needed. -
withTool
Register a tool. Throws IllegalArgumentException for a null tool, a name that isn't lower_snake_case (at most 64 characters), a duplicate name, or a kind other than READ or NAVIGATION. -
getTools
The registered tools, by name (sorted, unmodifiable). -
getName
- Specified by:
getNamein interfaceTopLevelMetaDataInterface
-
validate
A contributed tool may not take a built-in tool's name.- Specified by:
validatein interfaceQSupplementalInstanceMetaData
-