Class OrderAgent

All Implemented Interfaces:
GuardedExecution, ScopeAuthority, ArtifactRegistryAware, ConversationCarrier, Identifiable, Job<OrderAnswer>, ModelDependent, ModelDependentTool<OrderQuestion, OrderAnswer>, Orchestrator<OrderQuestion, OrderAnswer>, Thinker<OrderQuestion, OrderAnswer>, Tool<OrderQuestion, OrderAnswer>

public class OrderAgent extends SingleObjectiveThinker<OrderQuestion, OrderAnswer>
An agent is a model working in a loop with tools: it reads the question, decides which tool to call, reads what came back, and goes on until it can answer. Nobody wrote "look up A-1002, then A-1005" - the order of the work is the model's decision, which is what an agent is for. In Nucleo an agent is called a thinker; a SingleObjectiveThinker works toward one final answer.

ThinkerDeclaration states what the agent needs from the model that serves it: Grade.SMALL is the capability rung, OutputSize.COMPACT how long a single turn may be (a tool call, or an answer with a handful of fields). Both are required, so an agent without them does not compile.

getSystemPromptText() is the standing instructions the model reads before the question; @StaticPrompt registers the text under a key so a deployment can replace the wording without changing the class. declareDefaultTools() is the palette, the tools the model may call, each shown to it with the name, description and input form the tool class itself declares. The answer handler reads the final answer into an OrderAnswer.

When the model calls the tool with a malformed number, the tool's typed refusal goes back to it as the result of that call, marked as a mistake it can correct, and the model calls again; nothing in this class handles it.

Since:
0.1 (2026-09-27)
Author:
Andrey Santrosyan
  • Constructor Details

  • Method Details

    • getSystemPromptText

      protected String getSystemPromptText()
      Description copied from class: SingleObjectiveThinker
      Simple-case override: return the static system-prompt text. Annotate the override with @StaticPrompt to declare the immutability contract.

      The auto-derived registry key is the subclass FQN. Pin an explicit key on the annotation (@StaticPrompt("ops.visible.key")) when ops needs a stable name for DB-stored overrides that survives class renames.

      Overrides:
      getSystemPromptText in class SingleObjectiveThinker<OrderQuestion, OrderAnswer>
    • declareDefaultTools

      protected List<Class<? extends Tool>> declareDefaultTools()
      Description copied from class: AbstractThinker
      Declares the core tools this thinker always has loaded with full schemas. Called during construction to initialize the tool registry.
      Specified by:
      declareDefaultTools in class AbstractThinker<OrderQuestion, OrderAnswer>
      Returns:
      List of tool classes, or empty list if no tools needed