Package com.tnsai.rag
Record Class KnowledgeEntry
java.lang.Object
java.lang.Record
com.tnsai.rag.KnowledgeEntry
- Record Components:
source- what to load and from whereuse- how the loaded documents reach the modelmaxTokens- explicit DIRECT budget; empty means the default budgetsearch- search settings this source contributes to its scope
public record KnowledgeEntry(KnowledgeSourceConfig source, Knowledge.Use use, OptionalInt maxTokens, Optional<SearchSettings> search)
extends Record
One declared knowledge source together with how a scope uses it.
Produced by KnowledgeDeclarations from a Knowledge
declaration, after an action's overlay has been applied: use is
already resolved (an unset use is Knowledge.Use.SEARCH), and
maxTokens and search are the values that apply.
- Since:
- 0.18.0
-
Constructor Summary
ConstructorsConstructorDescriptionKnowledgeEntry(KnowledgeSourceConfig source, Knowledge.Use use, OptionalInt maxTokens, Optional<SearchSettings> search) Creates an instance of aKnowledgeEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themaxTokensrecord component.name()search()Returns the value of thesearchrecord component.static KnowledgeEntrysearch(KnowledgeSourceConfig source) A source searched with the scope's settings, as anAgentBuildersource is.source()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.use()Returns the value of theuserecord component.
-
Constructor Details
-
KnowledgeEntry
public KnowledgeEntry(KnowledgeSourceConfig source, Knowledge.Use use, OptionalInt maxTokens, Optional<SearchSettings> search) Creates an instance of aKnowledgeEntryrecord class.
-
-
Method Details
-
search
A source searched with the scope's settings, as anAgentBuildersource is.- Parameters:
source- the source- Returns:
- a SEARCH entry contributing no search settings of its own
-
name
- Returns:
- the declared knowledge name
-
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). -
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
use
Returns the value of theuserecord component.- Returns:
- the value of the
userecord component
-
maxTokens
Returns the value of themaxTokensrecord component.- Returns:
- the value of the
maxTokensrecord component
-
search
Returns the value of thesearchrecord component.- Returns:
- the value of the
searchrecord component
-