Record Class WatsonxAiChatResults
java.lang.Object
java.lang.Record
org.springframework.ai.watsonx.api.WatsonxAiChatResults
- Record Components:
generatedText
- the generated textgeneratedTokenCount
- the number of tokens generatedinputTokenCount
- the number of tokens in the inputstopReason
- the reason the generation stopped
public record WatsonxAiChatResults(String generatedText, Integer generatedTokenCount, Integer inputTokenCount, String stopReason)
extends Record
Java class for Watsonx.ai Chat Results object.
- Since:
- 1.0.0
- Author:
- Pablo Sanchidrian Herrera
-
Constructor Summary
ConstructorDescriptionWatsonxAiChatResults
(String generatedText, Integer generatedTokenCount, Integer inputTokenCount, String stopReason) Creates an instance of aWatsonxAiChatResults
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of thegeneratedText
record component.Returns the value of thegeneratedTokenCount
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of theinputTokenCount
record component.Returns the value of thestopReason
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
WatsonxAiChatResults
public WatsonxAiChatResults(String generatedText, Integer generatedTokenCount, Integer inputTokenCount, String stopReason) Creates an instance of aWatsonxAiChatResults
record class.- Parameters:
generatedText
- the value for thegeneratedText
record componentgeneratedTokenCount
- the value for thegeneratedTokenCount
record componentinputTokenCount
- the value for theinputTokenCount
record componentstopReason
- the value for thestopReason
record component
-
-
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)
. -
generatedText
Returns the value of thegeneratedText
record component.- Returns:
- the value of the
generatedText
record component
-
generatedTokenCount
Returns the value of thegeneratedTokenCount
record component.- Returns:
- the value of the
generatedTokenCount
record component
-
inputTokenCount
Returns the value of theinputTokenCount
record component.- Returns:
- the value of the
inputTokenCount
record component
-
stopReason
Returns the value of thestopReason
record component.- Returns:
- the value of the
stopReason
record component
-