Package dev.langchain4j.rag.query.router
Class DefaultQueryRouter
-
- All Implemented Interfaces:
-
dev.langchain4j.rag.query.router.QueryRouter
public class DefaultQueryRouter implements QueryRouter
Default implementation of QueryRouter intended to be suitable for the majority of use cases. It's important to note that while efforts will be made to avoid breaking changes, the default behavior of this class may be updated in the future if it's found that the current behavior does not adequately serve the majority of use cases. Such changes would be made to benefit both current and future users. This implementation always routes all Querys to one or multiple ContentRetrievers provided in the constructor.
-
-
Constructor Summary
Constructors Constructor Description DefaultQueryRouter(Array<ContentRetriever> contentRetrievers)
DefaultQueryRouter(Collection<ContentRetriever> contentRetrievers)
-
Method Summary
Modifier and Type Method Description Collection<ContentRetriever>
route(Query query)
Routes the given Query to one or multiple ContentRetrievers. -
-
Constructor Detail
-
DefaultQueryRouter
DefaultQueryRouter(Array<ContentRetriever> contentRetrievers)
-
DefaultQueryRouter
DefaultQueryRouter(Collection<ContentRetriever> contentRetrievers)
-
-
Method Detail
-
route
Collection<ContentRetriever> route(Query query)
Routes the given Query to one or multiple ContentRetrievers.
- Parameters:
query
- The Query to be routed.- Returns:
A collection of one or more ContentRetrievers to which the Query should be routed.
-
-
-
-