Package com.tnsai.rag
Record Class ChatKnowledgeContext.Turn
java.lang.Object
java.lang.Record
com.tnsai.rag.ChatKnowledgeContext.Turn
- Record Components:
beforeSearch- blocks declared before the first SEARCH entry, or every block when no entry is SEARCHafterSearch- blocks declared after the first SEARCH entryusage- one row per chat source, in declaration order: what each DIRECT source gave, and a zero row for each SEARCH source that the turn's search fills in
- Enclosing interface:
ChatKnowledgeContext
public static record ChatKnowledgeContext.Turn(List<String> beforeSearch, List<String> afterSearch, List<KnowledgeUsage> usage)
extends Record
One turn's blocks, split at the first SEARCH entry.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ChatKnowledgeContext.TurnA turn that gives nothing. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theafterSearchrecord component.Returns the value of thebeforeSearchrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisEmpty()final StringtoString()Returns a string representation of this record class.usage()Returns the value of theusagerecord component.
-
Field Details
-
EMPTY
A turn that gives nothing.
-
-
Constructor Details
-
Turn
Creates an instance of aTurnrecord class.- Parameters:
beforeSearch- the value for thebeforeSearchrecord componentafterSearch- the value for theafterSearchrecord componentusage- the value for theusagerecord component
-
Turn
A turn with no usage rows.- Parameters:
beforeSearch- blocks declared before the first SEARCH entryafterSearch- blocks declared after the first SEARCH entry
-
-
Method Details
-
isEmpty
public boolean isEmpty()- Returns:
- whether the turn gives no block at all
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
beforeSearch
Returns the value of thebeforeSearchrecord component.- Returns:
- the value of the
beforeSearchrecord component
-
afterSearch
Returns the value of theafterSearchrecord component.- Returns:
- the value of the
afterSearchrecord component
-
usage
Returns the value of theusagerecord component.- Returns:
- the value of the
usagerecord component
-