Interface PlatformAgentFactory


public interface PlatformAgentFactory
Hands out pre-loaded ComposedAgent.Builders backed by Designer-side tool surfaces. Obtained through DesignerAiContext.agents(); the factory captures the surrounding DesignerContext once and is reused for every caller that needs the same baseline agents.

Each accessor returns a fresh ComposedAgent.Builder on every call, pre-seeded with the agent's baseline preamble, tools, and context. Callers layer host-specific framing, extra tools, and context sections on the builder and call ComposedAgent.Builder.build() to produce the final Agent.

  • Method Details

    • scriptingAgent

      ComposedAgent.Builder scriptingAgent()
      Pre-loaded ComposedAgent.Builder for a Jython scripting agent — seeded with the Jython 2.7 preamble and the read-only tool bundles from the surrounding DesignerToolFactory.

      Callers typically add host-specific framing and a caller-context section before building:

      Agent agent = factory.scriptingAgent()
          .typeId("com.example.scripting.repl")
          .framing("The user is in a REPL — emit complete script snippets...")
          .contextSection("Caller context", () -> callerContext)
          .build();
      
    • extensionFunctionAgent

      ComposedAgent.Builder extensionFunctionAgent(com.inductiveautomation.ignition.common.script.typing.ExtensionFunctionDescriptor descriptor)
      Pre-loaded ComposedAgent.Builder for an extension-function body editor — extends the scripting agent with extension function framing and a "Function signature" context section rendered from descriptor.

      Callers typically add a caller-context section before building:

      Agent agent = factory.extensionFunctionAgent(descriptor)
          .contextSection("Caller context", this::getAssistContext)
          .build();
      
      Parameters:
      descriptor - the extension function whose signature should be rendered into the "Function signature" context section.
    • expressionAgent

      ComposedAgent.Builder expressionAgent(FunctionFactory factory)
      Pre-loaded ComposedAgent.Builder for the Ignition expression-language assistant. The base agent carries its own system prompt and tag-read tools and renders factory as a Markdown function catalog. Callers typically add a caller-context section before building:
      Agent agent = factory.expressionAgent(functionFactory)
          .contextSection("Caller context", () -> myContext)
          .build();
      
      Parameters:
      factory - the expression-language function catalog the agent should advertise — typically the host editor's FunctionFactory.