Class ScriptingAgent
java.lang.Object
com.inductiveautomation.ignition.designer.ai.agent.ScriptingAgent
- All Implemented Interfaces:
Agent
-
Nested Class Summary
Nested classes/interfaces inherited from interface Agent
Agent.AgentFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFraming for an extension-function body editor: the agent emits only the body, deferring the panel-manageddefline.static final StringThe type id of an agent built withScriptingAgent(DesignerToolFactory, ExtensionFunctionDescriptor).static final StringThe Jython 2.7 primer every scripting agent shares: indentation rules, unicode string conventions, and a nudge toward the system-library lookup tools.static final String -
Constructor Summary
ConstructorsConstructorDescriptionScriptingAgent(DesignerToolFactory toolFactory) ScriptingAgent(DesignerToolFactory toolFactory, com.inductiveautomation.ignition.common.script.typing.ExtensionFunctionDescriptor function) An agent for editing the body offunction: typed asEXTENSION_FUNCTION_TYPE_ID, framed withEXTENSION_FUNCTION_BODY_FRAMING, and given the function's signature as additional context. -
Method Summary
Modifier and TypeMethodDescriptionSupplemental context to be folded into the prompt (e.g.Human and Agent readable description used in logs and routing.getName()Human-readable name used in logs and routing.System prompt that primes the model for this agent's role.getTools()Callable tools exposed to the model.Stable type identifier for this agent type.static StringrenderFunctionSignature(com.inductiveautomation.ignition.common.script.typing.ExtensionFunctionDescriptor descriptor) Renders the Markdown body of a "Function signature" context section for an extension function: thedefline in a fenced block, the descriptor's prose description if present, and a bulleted list of parameters with their types and per-parameter descriptions.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Agent
getMaxTurnsPerInvocation, toBuilder
-
Field Details
-
TYPE_ID
- See Also:
-
EXTENSION_FUNCTION_TYPE_ID
The type id of an agent built withScriptingAgent(DesignerToolFactory, ExtensionFunctionDescriptor).- See Also:
-
JYTHON_PREAMBLE
The Jython 2.7 primer every scripting agent shares: indentation rules, unicode string conventions, and a nudge toward the system-library lookup tools. The platform scripting agent uses this as its system prompt; exposed here for callers building their own agent without extending the platform one.- See Also:
-
EXTENSION_FUNCTION_BODY_FRAMING
Framing for an extension-function body editor: the agent emits only the body, deferring the panel-manageddefline. Appended to the system prompt of an agent built withScriptingAgent(DesignerToolFactory, ExtensionFunctionDescriptor).- See Also:
-
-
Constructor Details
-
ScriptingAgent
-
ScriptingAgent
public ScriptingAgent(DesignerToolFactory toolFactory, com.inductiveautomation.ignition.common.script.typing.ExtensionFunctionDescriptor function) An agent for editing the body offunction: typed asEXTENSION_FUNCTION_TYPE_ID, framed withEXTENSION_FUNCTION_BODY_FRAMING, and given the function's signature as additional context.
-
-
Method Details
-
renderFunctionSignature
public static String renderFunctionSignature(com.inductiveautomation.ignition.common.script.typing.ExtensionFunctionDescriptor descriptor) Renders the Markdown body of a "Function signature" context section for an extension function: thedefline in a fenced block, the descriptor's prose description if present, and a bulleted list of parameters with their types and per-parameter descriptions.Pair with
ComposedAgent.Builder.contextSection(String, java.util.function.Supplier)under the heading"Function signature":.contextSection("Function signature", () -> ScriptingAgent.renderFunctionSignature(panel.getDescriptor()))- Parameters:
descriptor- the function descriptor to render.- Returns:
- the Markdown body, without a heading; never blank.
-
getTypeId
-
getName
-
getDescription
Description copied from interface:AgentHuman and Agent readable description used in logs and routing.- Specified by:
getDescriptionin interfaceAgent
-
getSystemPrompt
Description copied from interface:AgentSystem prompt that primes the model for this agent's role.- Specified by:
getSystemPromptin interfaceAgent
-
getTools
Description copied from interface:AgentCallable tools exposed to the model. Typically built fromTool-annotated methods viaTools.fromAnnotated(Object...), but may include hand-rolledCallableToolimplementations. Returns an empty list if the agent declares no tools. -
getAdditionalContext
Description copied from interface:AgentSupplemental context to be folded into the prompt (e.g. project state, schema, current selection), or empty if none is provided.- Specified by:
getAdditionalContextin interfaceAgent
-