Record Class ContextSection
java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.common.ai.ContextSection
- Record Components:
heading- the section heading, rendered as a level-2 markdown heading.body- the section body. Already trimmed byof(String, String).
A heading and body pair contributed to an
Agent's additional context. The combiner in
ComposedAgent renders each section as ## heading\n\nbody; bodies that arrive
without a heading or with no body are excluded by construction via of(String, String).-
Constructor Summary
ConstructorsConstructorDescriptionContextSection(String heading, String body) Creates an instance of aContextSectionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.heading()Returns the value of theheadingrecord component.static Optional<ContextSection> Builds a section ifbodyis non-null and not blank, otherwise empty.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ContextSection
-
-
Method Details
-
of
Builds a section ifbodyis non-null and not blank, otherwise empty. The body is trimmed before storage so callers don't have to.- Parameters:
heading- the section heading.body- the section body, or null if no body is available.- Returns:
- a section wrapping
headingand the trimmed body, or empty ifbodyis null or 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). -
heading
-
body
-