Class ComposedAgent.Builder

java.lang.Object
com.inductiveautomation.ignition.common.ai.ComposedAgent.Builder
Enclosing class:
ComposedAgent

public static final class ComposedAgent.Builder extends Object
Builder for ComposedAgent. Obtain via the ComposedAgent.builder(...) factories.
  • Method Details

    • typeId

      public ComposedAgent.Builder typeId(String typeId)
      Overrides the type identifier. When extending a base agent, defaults to the base's typeId.
    • name

      public ComposedAgent.Builder name(String name)
      Overrides the human-readable name. When extending a base agent, defaults to the base's name.
    • description

      public ComposedAgent.Builder description(String description)
      Overrides the description. When extending a base agent, defaults to the base's description; required when not extending a base.
    • maxTurnsPerInvocation

      public ComposedAgent.Builder maxTurnsPerInvocation(int maxTurnsPerInvocation)
      Overrides the turn limit. When extending a base agent, defaults to the base's limit, so a decorator that only splices in tools keeps the base's configured value rather than falling back to Agent.getMaxTurnsPerInvocation()'s default.
    • preamble

      public ComposedAgent.Builder preamble(SystemPromptPart preamble)
      Sets the system-prompt preamble — typically a language- or domain-level primer shared across several agent configurations. When extending a base agent, the base's system prompt is rendered first, then the preamble, then the framing. Replaces any previously-set preamble.
    • preamble

      public ComposedAgent.Builder preamble(String preamble)
      Convenience overload that wraps preamble into a SystemPromptPart. See preamble(SystemPromptPart) for ordering semantics.
    • framing

      public ComposedAgent.Builder framing(SystemPromptPart framing)
      Sets the system-prompt framing — typically a description of the specific editing situation the agent is helping with. Rendered after the preamble (and after a base agent's system prompt, if extending one). Replaces any previously-set framing.
    • framing

      public ComposedAgent.Builder framing(String framing)
      Convenience overload that wraps framing into a SystemPromptPart. See framing(SystemPromptPart) for ordering semantics.
    • tools

      public ComposedAgent.Builder tools(ToolBundle... bundles)
      Appends tool bundles to the agent's tool list. May be called repeatedly; bundles are concatenated in the order they were added. When extending a base agent, the base's tools are placed first; bundles supplied here follow.
    • contextSection

      public ComposedAgent.Builder contextSection(AdditionalContextPart part)
      Appends an additional-context part. Sections are rendered in the order they were added. When extending a base agent, the base's additional context is rendered first; sections supplied here follow.
    • contextSection

      public ComposedAgent.Builder contextSection(String heading, Supplier<@Nullable String> body)
      Convenience overload that wraps body into a ContextSection under heading. The supplier is invoked once during build(); if it returns null or a blank string the section is omitted, otherwise its result is trimmed before rendering.
    • build

      public ComposedAgent build()
      Materializes the agent by evaluating every slot once.
      Throws:
      NullPointerException - if no description has been set and no base agent was supplied.