Package dev.langchain4j.rag.query.router
Class DefaultQueryRouter
java.lang.Object
dev.langchain4j.rag.query.router.DefaultQueryRouter
- All Implemented Interfaces:
QueryRouter
Default implementation of
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
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
Query
s
to one or multiple ContentRetriever
s provided in the constructor.- See Also:
-
Constructor Summary
ConstructorDescriptionDefaultQueryRouter
(ContentRetriever... contentRetrievers) DefaultQueryRouter
(Collection<ContentRetriever> contentRetrievers) -
Method Summary
-
Constructor Details
-
DefaultQueryRouter
-
DefaultQueryRouter
-
-
Method Details
-
route
Description copied from interface:QueryRouter
Routes the givenQuery
to one or multipleContentRetriever
s.- Specified by:
route
in interfaceQueryRouter
- Parameters:
query
- TheQuery
to be routed.- Returns:
- A collection of one or more
ContentRetriever
s to which theQuery
should be routed.
-