Interface ModelProvider.Custom

All Superinterfaces:
ModelProvider
Enclosing interface:
ModelProvider

public static non-sealed interface ModelProvider.Custom extends ModelProvider
Custom models can be added by implementing this interface and, and the underlying implementations of dev.langchain4j.model.chat.ChatModel and (optionally) dev.langchain4j.model.chat.StreamingChatModel.

Refer to the Langchain4j documentation or reference implementations for how to implement the ChatModel and StreamingChatModel.

  • Method Details

    • createChatModel

      Object createChatModel()
      Returns:
      an instance of dev.langchain4j.model.chat.ChatModel
    • createStreamingChatModel

      Object createStreamingChatModel()
      If you don't need streaming you can throw an exception from this method.
      Returns:
      an instance of dev.langchain4j.model.chat.StreamingChatModel