Client Referencerouters
semantic_router.routers.decision
a router that asks a decision model which route applies. one call answers many questions.
DecisionRouter Objects
class DecisionRouter(BaseRouter)routes by asking a decision model one choice question: which route applies.
Arguments:
model: The decision model that answers, e.g.GLiNER2DecisionModel()locally orTypeSafeDecisionModel()over HTTP.routes: The routes to choose between.instructions: The question asked about each query.confidence_threshold: The confidence a route needs, unless it sets its own.calibrator: A fitted score -> probability map;fit()makes one.
route_question
def route_question() -> Questionthe choice question for the current route set; descriptions beat utterance samples
aask
async def aask(state: object, questions: dict[str,
Question]) -> dict[str, Answer]answer several typed questions about one state in a single model pass.