Record Class ChatResult

java.lang.Object
java.lang.Record
com.axelor.ai.chat.ChatResult
Record Components:
finishReason - why the LLM stopped generating
inputTokens - number of input/prompt tokens used (null if unavailable)
outputTokens - number of output/completion tokens used (null if unavailable)
cacheReadTokens - input tokens served from provider cache (null if unavailable)
cacheWriteTokens - input tokens written to provider cache (null if unavailable)
modelCode - the model code used (null if unknown)
providerCode - the provider code used (null if unknown)

public record ChatResult(FinishReason finishReason, Integer inputTokens, Integer outputTokens, Integer cacheReadTokens, Integer cacheWriteTokens, String modelCode, String providerCode) extends Record
Outcome of a single LLM turn, delivered via ChatProvider.Listener.onFinish(com.axelor.ai.chat.ChatResult).
  • Constructor Details

  • 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.
    • finishReason

      public FinishReason finishReason()
      Returns the value of the finishReason record component.
      Returns:
      the value of the finishReason record component
    • inputTokens

      public Integer inputTokens()
      Returns the value of the inputTokens record component.
      Returns:
      the value of the inputTokens record component
    • outputTokens

      public Integer outputTokens()
      Returns the value of the outputTokens record component.
      Returns:
      the value of the outputTokens record component
    • cacheReadTokens

      public Integer cacheReadTokens()
      Returns the value of the cacheReadTokens record component.
      Returns:
      the value of the cacheReadTokens record component
    • cacheWriteTokens

      public Integer cacheWriteTokens()
      Returns the value of the cacheWriteTokens record component.
      Returns:
      the value of the cacheWriteTokens record component
    • modelCode

      public String modelCode()
      Returns the value of the modelCode record component.
      Returns:
      the value of the modelCode record component
    • providerCode

      public String providerCode()
      Returns the value of the providerCode record component.
      Returns:
      the value of the providerCode record component