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
ConstructorsConstructorDescriptionPromptBuilderActor(String name, com.scivicslab.turingworkflow.workflow.IIActorSystem system) -
Method Summary
Modifier and TypeMethodDescriptioncom.scivicslab.pojoactor.core.ActionResultaddContext(String text) com.scivicslab.pojoactor.core.ActionResultaddMessage(String text) com.scivicslab.pojoactor.core.ActionResultaddWarning(String text) com.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResultgetContext(String indexStr) com.scivicslab.pojoactor.core.ActionResultgetContextCount(String ignored) com.scivicslab.pojoactor.core.ActionResultgetMessage(String ignored) com.scivicslab.pojoactor.core.ActionResultgetNextContext(String ignored) com.scivicslab.pojoactor.core.ActionResultgetNextWarning(String ignored) com.scivicslab.pojoactor.core.ActionResultgetWarning(String indexStr) com.scivicslab.pojoactor.core.ActionResultgetWarningCount(String ignored) com.scivicslab.pojoactor.core.ActionResultresetCursor(String ignored) Methods inherited from class com.scivicslab.turingworkflow.workflow.IIActorRef
callByActionName, hasAnnotatedAction, invokeAnnotatedAction, parseFirstArgumentMethods 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
-
Constructor Details
-
PromptBuilderActor
-
-
Method Details
-
clear
-
addWarning
-
addContext
-
addMessage
-
getWarningCount
-
getWarning
-
getContextCount
-
getContext
-
getNextWarning
-
getNextContext
-
resetCursor
-
getMessage
-
build
-