Class DecisionServices.Builder<T>

java.lang.Object
dev.langchain4j.service.decision.DecisionServices.Builder<T>
Enclosing class:
DecisionServices

public static class DecisionServices.Builder<T> extends Object
Builds decision services. Frameworks can extend it (see DecisionServicesFactory) to build their own implementations, for example at build time, using DecisionMethod for the analysis of each method.
Since:
1.21.0
  • Constructor Details

    • Builder

      protected Builder(Class<T> serviceInterface)
  • Method Details

    • decisionModel

      public DecisionServices.Builder<T> decisionModel(DecisionModel decisionModel)
    • thresholdProvider

      public DecisionServices.Builder<T> thresholdProvider(ThresholdProvider thresholdProvider)
      Provides the threshold for boolean answers: the answer is true when the probability of "yes" is greater than or equal to the threshold. The provider is called on every invocation, so thresholds can come from configuration that changes at runtime. When it returns null, or is not set, the threshold is 0.5.
    • serviceInterface

      protected Class<T> serviceInterface()
    • decisionModel

      protected DecisionModel decisionModel()
    • thresholdProvider

      protected ThresholdProvider thresholdProvider()
    • build

      public T build()