Class InstalledModulesContextSupplier
java.lang.Object
com.inductiveautomation.ignition.designer.ai.context.InstalledModulesContextSupplier
Renders a markdown listing of every Ignition module currently installed on the connected gateway,
suitable for injection into an AI agent's system prompt via
Agent.getAdditionalContext().
Each entry shows the module's qualified id, display name, and version when available.
The list is read from the supplied source on each call, so modules added or removed after construction are reflected.
Example:
InstalledModulesContextSupplier supplier =
new InstalledModulesContextSupplier(clientContext::getModules);
// In an Agent implementation:
@Override
public Optional<String> getAdditionalContext() {
return supplier.getOptional();
}
-
Constructor Summary
ConstructorsConstructorDescriptionInstalledModulesContextSupplier(Supplier<List<ModuleInfo>> modulesSupplier) Creates a supplier backed by the given source. -
Method Summary
Modifier and TypeMethodDescriptionget()Returns the rendered listing of installed modules.Returns the rendered listing wrapped in anOptional, orOptional.empty()when no modules are reported.
-
Constructor Details
-
InstalledModulesContextSupplier
Creates a supplier backed by the given source.- Parameters:
modulesSupplier- source of installed-module info, queried on every render.
-
-
Method Details
-
get
Returns the rendered listing of installed modules. Callers folding this intoAgent.getAdditionalContext()should prefergetOptional(), which omits the section when no modules are installed. -
getOptional
Returns the rendered listing wrapped in anOptional, orOptional.empty()when no modules are reported. Designed to be returned directly fromAgent.getAdditionalContext()or composed with other context suppliers.- Returns:
- the rendered listing if any modules are installed, otherwise empty.
-