Package dev.langchain4j.agentic.scope
Record Class ResultWithAgenticScope<T>
java.lang.Object
java.lang.Record
dev.langchain4j.agentic.scope.ResultWithAgenticScope<T>
- Type Parameters:
T
- The type of the result.
Holds the result of an agent invocation along with its associated
AgenticScope
.
This is useful for returning results from agents while also providing access to the cognitive
scope through which that result has been generated.-
Constructor Summary
ConstructorsConstructorDescriptionResultWithAgenticScope
(AgenticScope agenticScope, T result) Creates an instance of aResultWithAgenticScope
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theagenticScope
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.result()
Returns the value of theresult
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ResultWithAgenticScope
Creates an instance of aResultWithAgenticScope
record class.- Parameters:
agenticScope
- the value for theagenticScope
record componentresult
- the value for theresult
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)
. -
agenticScope
Returns the value of theagenticScope
record component.- Returns:
- the value of the
agenticScope
record component
-
result
Returns the value of theresult
record component.- Returns:
- the value of the
result
record component
-