Record Class LLMSystemPrompt.Identity
java.lang.Object
java.lang.Record
me.neurodock.core.LLMSystemPrompt.Identity
- Record Components:
name- the model's given name (e.g."Alice"), ornull/blank to omitrole- the model's role (e.g."Personal assistant"), ornull/blank to omitpurpose- the model's purpose/goal, ornull/blank to omit
- Enclosing class:
LLMSystemPrompt
public static record LLMSystemPrompt.Identity(String name, String role, String purpose)
extends Record
The persona/role block of a system prompt — who the model is and what it's for.
At least one of name, role, or purpose must be non-blank;
build() throws if all three are absent, since an empty identity block is
almost certainly a mistake rather than an intentional choice.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the identity sentence from whichever ofname,role, andpurposeare present, joining them with commas.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.purpose()Returns the value of thepurposerecord component.role()Returns the value of therolerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Identity
-
-
Method Details
-
build
Builds the identity sentence from whichever ofname,role, andpurposeare present, joining them with commas.- Returns:
- the composed identity sentence, e.g.
"You are Alice, Your role is Personal assistant" - Throws:
IllegalArgumentException- ifname,role, andpurposeare allnullor blank
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
name
-
role
-
purpose
-