Class LLMSystemPrompt.Builder
java.lang.Object
me.neurodock.core.LLMSystemPrompt.Builder
- Enclosing class:
LLMSystemPrompt
Builder for assembling an
LLMSystemPrompt from its component sections.
Obtain an instance via LLMSystemPrompt.builder().-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the pre-built behavior body for the prompt being built directly, bypassingloadBehaviorFromFile(String).build()Builds theLLMSystemPromptfrom the sections configured on this builder.capabilities(LLMSystemPrompt.Capabilities capabilities) Sets the capability usage-hint definitions for the prompt being built.Sets the pre-built static-context body for the prompt being built.identity(LLMSystemPrompt.Identity identity) Sets the identity/persona block for the prompt being built.loadBehaviorFromFile(String path) Loadsbehaviorfrom a text file, resolved in order against: the classpathOptions.getDataDir()the current runtime/working directory an exact file path matchoutputFormat(LLMSystemPrompt.OutputFormat outputFormat) Sets the output format specification for the prompt being built.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
loadBehaviorFromFile
Loadsbehaviorfrom a text file, resolved in order against:- the classpath
Options.getDataDir()- the current runtime/working directory
- an exact file path match
- Parameters:
path- the file to look for, resolved as described above- Returns:
- this
LLMSystemPrompt.Builder, for chaining - Throws:
IllegalStateException- if no file could be found at any of the candidate locations, or if it exists but cannot be read
-
identity
Sets the identity/persona block for the prompt being built.- Parameters:
identity- the identity to use- Returns:
- this
LLMSystemPrompt.Builder, for chaining
-
context
Sets the pre-built static-context body for the prompt being built.- Parameters:
context- the context body, typically produced viaLLMSystemPrompt.Context.build()- Returns:
- this
LLMSystemPrompt.Builder, for chaining
-
capabilities
Sets the capability usage-hint definitions for the prompt being built. These are only compiled into prompt text onceLLMSystemPrompt.generateCapabilities(ArrayList)is called on the built instance.- Parameters:
capabilities- the usage-hint definitions to use- Returns:
- this
LLMSystemPrompt.Builder, for chaining
-
behavior
Sets the pre-built behavior body for the prompt being built directly, bypassingloadBehaviorFromFile(String).- Parameters:
behavior- the behavior/constraints text to use- Returns:
- this
LLMSystemPrompt.Builder, for chaining
-
outputFormat
Sets the output format specification for the prompt being built.- Parameters:
outputFormat- the output format to use- Returns:
- this
LLMSystemPrompt.Builder, for chaining
-
build
Builds theLLMSystemPromptfrom the sections configured on this builder.- Returns:
- a new
LLMSystemPrompt
-