Package dev.langchain4j.rag.query.router
Enum Class LanguageModelQueryRouter.FallbackStrategy
java.lang.Object
java.lang.Enum<LanguageModelQueryRouter.FallbackStrategy>
dev.langchain4j.rag.query.router.LanguageModelQueryRouter.FallbackStrategy
- All Implemented Interfaces:
Serializable
,Comparable<LanguageModelQueryRouter.FallbackStrategy>
,Constable
- Enclosing class:
LanguageModelQueryRouter
public static enum LanguageModelQueryRouter.FallbackStrategy
extends Enum<LanguageModelQueryRouter.FallbackStrategy>
Strategy applied if the call to the LLM fails of if LLM does not return a valid response.
It could be because it was formatted improperly, or it is unclear where to route.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionIn this case, theQuery
will not be routed to anyContentRetriever
, thus skipping the RAG flow.In this case, an original exception will be re-thrown, and the RAG flow will fail.In this case, theQuery
will be routed to allContentRetriever
s. -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DO_NOT_ROUTE
In this case, theQuery
will not be routed to anyContentRetriever
, thus skipping the RAG flow. No content will be appended to the originalUserMessage
. -
ROUTE_TO_ALL
In this case, theQuery
will be routed to allContentRetriever
s. -
FAIL
In this case, an original exception will be re-thrown, and the RAG flow will fail.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-