Class PromptBuilderActor

java.lang.Object
com.scivicslab.pojoactor.core.ActorRef<PromptBuilderActor>
com.scivicslab.turingworkflow.workflow.IIActorRef<PromptBuilderActor>
com.scivicslab.turingworkflow.plugins.promptbuilder.PromptBuilderActor
All Implemented Interfaces:
com.scivicslab.pojoactor.core.CallableByActionName, AutoCloseable

public class PromptBuilderActor extends com.scivicslab.turingworkflow.workflow.IIActorRef<PromptBuilderActor>
Assembles a prompt step-by-step from warnings, context, and a message.

Workflow steps call addWarning/addContext/addMessage in sequence, then call build to produce the final prompt string in ${result}. This ensures constraints are always explicitly included in the prompt rather than relying on LLM memory or SKILL files that may be ignored.

Output format of build():

 [Constraints]
 - warning1
 - warning2

 [Context]
 - context1

 [Message]
 message body
 

Sections with no entries are omitted. build() fails if addMessage was not called.

  • Field Summary

    Fields inherited from class com.scivicslab.pojoactor.core.ActorRef

    actorName, actorSystem, object
  • Constructor Summary

    Constructors
    Constructor
    Description
    PromptBuilderActor(String name, com.scivicslab.turingworkflow.workflow.IIActorSystem system)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.scivicslab.pojoactor.core.ActionResult
     
    com.scivicslab.pojoactor.core.ActionResult
     
    com.scivicslab.pojoactor.core.ActionResult
     
    com.scivicslab.pojoactor.core.ActionResult
    build(String ignored)
     
    com.scivicslab.pojoactor.core.ActionResult
    clear(String ignored)
     
    com.scivicslab.pojoactor.core.ActionResult
    getContext(String indexStr)
     
    com.scivicslab.pojoactor.core.ActionResult
     
    com.scivicslab.pojoactor.core.ActionResult
    getMessage(String ignored)
     
    com.scivicslab.pojoactor.core.ActionResult
     
    com.scivicslab.pojoactor.core.ActionResult
     
    com.scivicslab.pojoactor.core.ActionResult
    getWarning(String indexStr)
     
    com.scivicslab.pojoactor.core.ActionResult
     
    com.scivicslab.pojoactor.core.ActionResult
     

    Methods inherited from class com.scivicslab.turingworkflow.workflow.IIActorRef

    callByActionName, hasAnnotatedAction, invokeAnnotatedAction, parseFirstArgument

    Methods inherited from class com.scivicslab.pojoactor.core.ActorRef

    ask, ask, askNow, clearJsonState, clearPendingMessages, close, createChild, expandVariables, getJsonBoolean, getJsonInt, getJsonString, getJsonString, getLastResult, getName, getNamesOfChildren, getParentName, hasJson, hasJsonState, initLogger, isAlive, json, putJson, setLastResult, setParentName, system, tell, tell, tellNow, toStringOfJson, toStringOfYaml

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PromptBuilderActor

      public PromptBuilderActor(String name, com.scivicslab.turingworkflow.workflow.IIActorSystem system)
  • Method Details

    • clear

      public com.scivicslab.pojoactor.core.ActionResult clear(String ignored)
    • addWarning

      public com.scivicslab.pojoactor.core.ActionResult addWarning(String text)
    • addContext

      public com.scivicslab.pojoactor.core.ActionResult addContext(String text)
    • addMessage

      public com.scivicslab.pojoactor.core.ActionResult addMessage(String text)
    • getWarningCount

      public com.scivicslab.pojoactor.core.ActionResult getWarningCount(String ignored)
    • getWarning

      public com.scivicslab.pojoactor.core.ActionResult getWarning(String indexStr)
    • getContextCount

      public com.scivicslab.pojoactor.core.ActionResult getContextCount(String ignored)
    • getContext

      public com.scivicslab.pojoactor.core.ActionResult getContext(String indexStr)
    • getNextWarning

      public com.scivicslab.pojoactor.core.ActionResult getNextWarning(String ignored)
    • getNextContext

      public com.scivicslab.pojoactor.core.ActionResult getNextContext(String ignored)
    • resetCursor

      public com.scivicslab.pojoactor.core.ActionResult resetCursor(String ignored)
    • getMessage

      public com.scivicslab.pojoactor.core.ActionResult getMessage(String ignored)
    • build

      public com.scivicslab.pojoactor.core.ActionResult build(String ignored)