Package com.embabel.agent.api.models
Class FallbackChatModelKt
-
- All Implemented Interfaces:
public final class FallbackChatModelKt
-
-
Method Summary
Modifier and Type Method Description final static ChatModelwithFallback(ChatModel $self, ChatModel model, Function1<Throwable, Boolean> whenError)final static LlmwithFallback(Llm $self, Llm fallbackTo, Function1<Throwable, Boolean> whenError)LLM that falls back to another LLM if the first one fails. -
-
Method Detail
-
withFallback
final static ChatModel withFallback(ChatModel $self, ChatModel model, Function1<Throwable, Boolean> whenError)
-
withFallback
final static Llm withFallback(Llm $self, Llm fallbackTo, Function1<Throwable, Boolean> whenError)
LLM that falls back to another LLM if the first one fails.
- Parameters:
fallbackTo- the LLM to fall back to if the first one fails
-
-
-
-