Class SystemLibraryPromptAssist
- All Implemented Interfaces:
PromptAssist
LibraryPromptAssist over Ignition's system.* scripting library, letting the user
drop a reference to a system function, constant, or whole package into an AI prompt.
The assist browses relative to the system root: the LibraryPromptAssist.label() ("System") stands
in for that root, so inserts produce @system:<path> tokens whose path omits the leading
system. (e.g. @system:tag.readBlocking). The body's Path: line carries
the full callable name (system.tag.readBlocking).
The default hints tree is the Designer's own (CommonContext.getScriptManager());
pass an explicit supplier for another scope. The
supplier is consulted on every browse, off the EDT, so a remotely-backed supplier must memoize.
-
Nested Class Summary
Nested classes/interfaces inherited from interface PromptAssist
PromptAssist.Option -
Constructor Summary
ConstructorsConstructorDescriptionSystemLibraryPromptAssist(DesignerContext context) Browses the Designer's own hints tree — theDesigner-scope view ofsystem.*.SystemLibraryPromptAssist(Supplier<PackageTreeNode> treeSupplier) Browses thesystempackage of whateverPackageTreeNodethe supplier returns. -
Method Summary
Modifier and TypeMethodDescriptionSelf-description appended to the embedded agent's system prompt.protected StringcallablePath(String path) Maps a browse path to the fully-qualified name a script invokes the symbol by, carried in the insert body'sPath:field.protected ScriptLibrarylibrary()The library this assist browses.protected @Nullable StringpackageDocumentation(com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor descriptor) The package's own documentation, carried in a package reference body'sDocumentation:field.Methods inherited from class LibraryPromptAssist
drillInDetail, id, label, options, separator
-
Constructor Details
-
SystemLibraryPromptAssist
Browses the Designer's own hints tree — theDesigner-scope view ofsystem.*. -
SystemLibraryPromptAssist
Browses thesystempackage of whateverPackageTreeNodethe supplier returns. The supplier is consulted on every browse, so the assist tracks the tree as it fills in — pass a scope-specific tree here to surface a scope other than the Designer's.
-
-
Method Details
-
agentContext
Description copied from interface:PromptAssistSelf-description appended to the embedded agent's system prompt. The embed concatenates the fragments from every mounted assist into a single addendum so each provider documents its own token shape and reference-body schema in one place, decoupled from any specific agent's translation rules. Fragments are expected to be Markdown; the embed adds a heading for each assist usingPromptAssist.label()and joins them with blank lines.The embed's framing already tells the model every token is shaped
@<id>:<path>and announces this assist's@<id>:prefix in its section heading, so the fragment should not restate the generic shape. It should cover:- the grammar of the
<path>portion, with a concrete example token; - the schema of the
<reference token="...">body</reference>body the embed will attach when one of those tokens appears — the line names (Path:,Type:, …) the agent should look for and what they mean; - a one-line statement of what the reference represents semantically (so the agent can reason about it without knowing this assist exists).
- Returns:
- the Markdown fragment, or
Optional.empty()when the assist has nothing to contribute (e.g. unit-test stubs).
- the grammar of the
-
library
Description copied from class:LibraryPromptAssistThe library this assist browses. Called on everyLibraryPromptAssist.options(String)invocation, off the EDT; aScriptLibraryis a cheap fixed view, so implementations build one against their source's current state per call.- Specified by:
libraryin classLibraryPromptAssist
-
callablePath
Description copied from class:LibraryPromptAssistMaps a browse path to the fully-qualified name a script invokes the symbol by, carried in the insert body'sPath:field. Identity by default; override when the library is browsed relative to an implicit root.- Overrides:
callablePathin classLibraryPromptAssist
-
packageDocumentation
protected @Nullable String packageDocumentation(com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor descriptor) Description copied from class:LibraryPromptAssistThe package's own documentation, carried in a package reference body'sDocumentation:field. The descriptor's computed description by default; return null to omit the field, as a library whose package descriptors carry synthetic text should.- Overrides:
packageDocumentationin classLibraryPromptAssist
-