Class DecisionResult<T>

java.lang.Object
dev.langchain4j.service.decision.DecisionResult<T>
Type Parameters:
T - the type of the content

@Experimental public final class DecisionResult<T> extends Object
The result of a decision service method together with the underlying DecisionResponse, which gives access to the raw answers (including probabilities), the model name and the token usage.
interface SupportDesk {

    @Decide("Which team should handle this ticket?")
    DecisionResult<Team> route(String ticket);
}
Since:
1.21.0
  • Method Details

    • builder

      public static <T> DecisionResult.Builder<T> builder()
    • content

      public T content()
    • response

      public DecisionResponse response()
      The response of the decision model. Answers are keyed by the name of the method (for a single question) or by the names of the fields of the returned object.
    • modelName

      public String modelName()
    • tokenUsage

      public TokenUsage tokenUsage()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object