Package com.embabel.agent.api.models
Class FallbackChatModel
-
- All Implemented Interfaces:
-
org.springframework.ai.chat.model.ChatModel,org.springframework.ai.chat.model.StreamingChatModel,org.springframework.ai.model.Model,org.springframework.ai.model.StreamingModel
public final class FallbackChatModel implements ChatModelChat model that falls back to another model if the first one fails.
-
-
Constructor Summary
Constructors Constructor Description FallbackChatModel(ChatModel model, ChatModel fallback, Function1<Throwable, Boolean> whenError)
-
Method Summary
Modifier and Type Method Description ChatResponsecall(Prompt prompt)-
Methods inherited from class org.springframework.ai.chat.model.ChatModel
call, call, getDefaultOptions, stream -
Methods inherited from class org.springframework.ai.chat.model.StreamingChatModel
stream, stream -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-