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 ChatModel
                        

    Chat model that falls back to another model if the first one fails.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      ChatResponse call(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
    • Constructor Detail

      • FallbackChatModel

        FallbackChatModel(ChatModel model, ChatModel fallback, Function1<Throwable, Boolean> whenError)
    • Method Detail

      • call

         ChatResponse call(Prompt prompt)