Record Class ValueSource

java.lang.Object
java.lang.Record
com.vaadin.flow.component.ai.common.ValueSource
Record Components:
confidence - how sure the model was, or null when the model did not report a level — meaning unknown, not low
extracts - the snippets the model read, in the order reported; never null, 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 Details

    • ValueSource

      public ValueSource(ConfidenceLevel confidence, List<SourceExtract> extracts)
      Creates a new value source.
      Parameters:
      confidence - how sure the model was, may be null
      extracts - the snippets the model read; null is treated as an empty list
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • confidence

      public ConfidenceLevel confidence()
      Returns the value of the confidence record component.
      Returns:
      the value of the confidence record component
    • extracts

      public List<SourceExtract> extracts()
      Returns the value of the extracts record component.
      Returns:
      the value of the extracts record component