Class ChatModelRoutingResult
java.lang.Object
dev.langchain4j.model.chat.router.ChatModelRoutingResult
The result of a
ChatModelRouter: the route that handles the request, or the default route of the routing
chat model.
ChatModelRouter router = request -> request.chatRequest().messages().size() > 20
? ChatModelRoutingResult.route("complex")
: ChatModelRoutingResult.defaultRoute();
- Since:
- 1.21.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic ChatModelRoutingResultRoutes the request to the default route of the routing chat model, for example when a router that calls a model is unsure.booleaninthashCode()booleanWhether the default route of the routing chat model is selected, in which caserouteName()isnull.static ChatModelRoutingResultRoutes the request to the route with the given name.The name of the selected route, ornullif the default route is used.toString()
-
Method Details
-
route
Routes the request to the route with the given name. -
defaultRoute
Routes the request to the default route of the routing chat model, for example when a router that calls a model is unsure. -
routeName
The name of the selected route, ornullif the default route is used. -
isDefaultRoute
public boolean isDefaultRoute()Whether the default route of the routing chat model is selected, in which caserouteName()isnull. -
equals
-
hashCode
-
toString
-