Class DecisionScoringModel.Builder
java.lang.Object
dev.langchain4j.model.scoring.DecisionScoringModel.Builder
- Enclosing class:
DecisionScoringModel
- Since:
- 1.21.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()decisionModel(DecisionModel decisionModel) Sets the decision model that scores the segments.listeners(ScoringModelListener... listeners) Sets the listeners notified before each scoring request, after each response and on each error.listeners(List<ScoringModelListener> listeners) Sets the listeners notified before each scoring request, after each response and on each error.maxSegmentsPerRequest(Integer maxSegmentsPerRequest) Sets the maximum number of segments sent in a single request to the decision model, so that the segments of a request do not exceed the input size accepted by the decision model.questionTemplate(PromptTemplate questionTemplate) Sets the template of the yes/no question asked for each segment, which must contain the{{document}}variable (the text of the segment).
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
decisionModel
Sets the decision model that scores the segments. Required. -
questionTemplate
Sets the template of the yes/no question asked for each segment, which must contain the{{document}}variable (the text of the segment). The score is the probability of "yes".Default value is
DecisionScoringModel.DEFAULT_QUESTION_TEMPLATE. -
maxSegmentsPerRequest
Sets the maximum number of segments sent in a single request to the decision model, so that the segments of a request do not exceed the input size accepted by the decision model.Default value is 20.
-
listeners
Sets the listeners notified before each scoring request, after each response and on each error. The listeners of the decision model are notified as well, once per request sent to it.- Parameters:
listeners- the listeners.- Returns:
this.
-
listeners
Sets the listeners notified before each scoring request, after each response and on each error. The listeners of the decision model are notified as well, once per request sent to it.- Parameters:
listeners- the listeners.- Returns:
this.
-
build
-