Record Class ValueSource
java.lang.Object
java.lang.Record
com.vaadin.flow.component.ai.common.ValueSource
- Record Components:
confidence- how sure the model was, ornullwhen the model did not report a level — meaning unknown, not lowextracts- the snippets the model read, in the order reported; nevernull, possibly empty
- All Implemented Interfaces:
Serializable
public record ValueSource(ConfidenceLevel confidence, List<SourceExtract> extracts)
extends Record
implements Serializable
The source data the LLM reported alongside one value it produced: the
snippets it read and how sure it was. A value can have more than one extract
— a multi-select filled from several lines, or a total summed from several
line items.
A source describes the value it was reported with. Once the field no longer holds that value, the source no longer applies.
- Since:
- 25.3
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionValueSource(ConfidenceLevel confidence, List<SourceExtract> extracts) Creates a new value source. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconfidencerecord component.final booleanIndicates whether some other object is "equal to" this one.extracts()Returns the value of theextractsrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ValueSource
Creates a new value source.- Parameters:
confidence- how sure the model was, may benullextracts- the snippets the model read;nullis treated as an empty list
-
-
Method Details
-
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). -
confidence
Returns the value of theconfidencerecord component.- Returns:
- the value of the
confidencerecord component
-
extracts
Returns the value of theextractsrecord component.- Returns:
- the value of the
extractsrecord component
-