Package com.tnsai.rag
Record Class RetrievalResult
java.lang.Object
java.lang.Record
com.tnsai.rag.RetrievalResult
- Record Components:
evidence- ranked retrieved evidencediagnostics- retrieval diagnostics
public record RetrievalResult(List<RetrievalEvidence> evidence, RetrievalDiagnostics diagnostics)
extends Record
Immutable outcome returned by a
RetrievalEngine.
An empty result is a successful retrieval outcome, not an error.
Configuration, timeout, provider, and execution failures use
RetrievalException; cooperative cancellation uses
CancellationException.
- Since:
- 0.13.0
-
Constructor Summary
ConstructorsConstructorDescriptionRetrievalResult(List<RetrievalEvidence> evidence, RetrievalDiagnostics diagnostics) Defensively copies evidence and verifies diagnostic consistency. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thediagnosticsrecord component.static RetrievalResultempty()Returns a successful empty retrieval outcome.final booleanIndicates whether some other object is "equal to" this one.evidence()Returns the value of theevidencerecord component.booleanReturns whether this result contains evidence.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RetrievalResult
Defensively copies evidence and verifies diagnostic consistency.
-
-
Method Details
-
empty
Returns a successful empty retrieval outcome.- Returns:
- empty result
-
hasEvidence
public boolean hasEvidence()Returns whether this result contains evidence.- Returns:
truewhen at least one evidence entry exists
-
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). -
evidence
Returns the value of theevidencerecord component.- Returns:
- the value of the
evidencerecord component
-
diagnostics
Returns the value of thediagnosticsrecord component.- Returns:
- the value of the
diagnosticsrecord component
-