DecisionModel
A model that decides instead of writing: it picks one of the options you give it, answers yes or no, or rates something on a scale, and says how sure it is. Such a model is fast and cheap, and its answer has a fixed type, which makes it a good fit for the places where a graph has to decide: which node comes next, whether an answer is good enough, whether a person has to look.
Use ChatDecisionModel to decide with a chat model you already have, an implementation from an integration module (telar-typesafe for Jev), or write one. In a test, a lambda is enough:
val model = DecisionModel { request ->
DecisionResponse(request.questions.mapValues { Answer.YesNo(1.0) })
}One request can ask several questions about the same DecisionRequest.state. For a single question, choose, isYes and score are shorter.
Inheritors
Functions
Asks which constant of the enum Option fits state. The model sees the names of the constants, and for each one the text that describe returns. Read the constant from the answer with value.
Returns an answer for each question of request, under the name the question has there.
Asks a yes/no question about state. Read Answer.YesNo.isYes, or compare Answer.YesNo.probability with a line of your own.