Package com.tnsai.reasoning
Record Class ReasoningStrategyHandle.ReasoningResult
java.lang.Object
java.lang.Record
com.tnsai.reasoning.ReasoningStrategyHandle.ReasoningResult
- Record Components:
answer- the final answer produced by the strategysuccess- whether the reasoning completed successfullymetadata- strategy-specific details (e.g., steps, tree, confidence)
- Enclosing interface:
ReasoningStrategyHandle
public static record ReasoningStrategyHandle.ReasoningResult(String answer, boolean success, Map<String,Object> metadata)
extends Record
Result of a reasoning operation.
-
Constructor Summary
ConstructorsConstructorDescriptionReasoningResult(String answer, boolean success, Map<String, Object> metadata) Creates an instance of aReasoningResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionanswer()Returns the value of theanswerrecord component.final booleanIndicates whether some other object is "equal to" this one.Creates a failed result.Creates a failed result with metadata.final inthashCode()Returns a hash code value for this object.metadata()Returns the value of themetadatarecord component.booleansuccess()Returns the value of thesuccessrecord component.Creates a successful result.Creates a successful result with metadata.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
success
Creates a successful result. -
success
public static ReasoningStrategyHandle.ReasoningResult success(String answer, Map<String, Object> metadata) Creates a successful result with metadata. -
failure
Creates a failed result. -
failure
public static ReasoningStrategyHandle.ReasoningResult failure(String reason, Map<String, Object> metadata) Creates a failed result with metadata. -
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 '=='. -
answer
Returns the value of theanswerrecord component.- Returns:
- the value of the
answerrecord component
-
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-