Package io.github.jbastgen.stemma.app.ai
Record Class AiResult
java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.app.ai.AiResult
- Record Components:
text- the answermillis- how long the whole request took, tries includedtries- how many tries it neededtruncated- the prompt was cut to the size limitredactions- how many secrets were masked in the prompt
public record AiResult(String text, long millis, int tries, boolean truncated, int redactions)
extends Record
The answer of an AI service.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longmillis()Returns the value of themillisrecord component.intReturns the value of theredactionsrecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.inttries()Returns the value of thetriesrecord component.booleanReturns the value of thetruncatedrecord component.
-
Constructor Details
-
AiResult
Creates an instance of aAiResultrecord class.- Parameters:
text- the value for thetextrecord componentmillis- the value for themillisrecord componenttries- the value for thetriesrecord componenttruncated- the value for thetruncatedrecord componentredactions- the value for theredactionsrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
millis
public long millis()Returns the value of themillisrecord component.- Returns:
- the value of the
millisrecord component
-
tries
public int tries()Returns the value of thetriesrecord component.- Returns:
- the value of the
triesrecord component
-
truncated
public boolean truncated()Returns the value of thetruncatedrecord component.- Returns:
- the value of the
truncatedrecord component
-
redactions
public int redactions()Returns the value of theredactionsrecord component.- Returns:
- the value of the
redactionsrecord component
-