Class HuggingFaceChatModel

java.lang.Object
dev.langchain4j.model.huggingface.HuggingFaceChatModel
All Implemented Interfaces:
dev.langchain4j.model.chat.ChatModel

@Deprecated(forRemoval=true, since="1.7.0-beta13") public class HuggingFaceChatModel extends Object implements dev.langchain4j.model.chat.ChatModel
Deprecated, for removal: This API element is subject to removal in a future version.
Please use OpenAiChatModel from the langchain4j-open-ai module instead:
ChatModel model = OpenAiChatModel.builder()
    .apiKey(System.getenv("HF_API_KEY"))
    .baseUrl("https://router.huggingface.co/v1")
    .modelName("HuggingFaceTB/SmolLM3-3B:hf-inference")
    .build();
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    HuggingFaceChatModel(String baseUrl, String accessToken, String modelId, Duration timeout, Double temperature, Integer maxNewTokens, Boolean returnFullText, Boolean waitForModel)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    HuggingFaceChatModel(String accessToken, String modelId, Duration timeout, Double temperature, Integer maxNewTokens, Boolean returnFullText, Boolean waitForModel)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    dev.langchain4j.model.chat.response.ChatResponse
    chat(dev.langchain4j.model.chat.request.ChatRequest chatRequest)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    withAccessToken(String accessToken)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface dev.langchain4j.model.chat.ChatModel

    chat, chat, chat, defaultRequestParameters, doChat, listeners, provider, supportedCapabilities
  • Constructor Details

    • HuggingFaceChatModel

      public HuggingFaceChatModel(String accessToken, String modelId, Duration timeout, Double temperature, Integer maxNewTokens, Boolean returnFullText, Boolean waitForModel)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • HuggingFaceChatModel

      public HuggingFaceChatModel(String baseUrl, String accessToken, String modelId, Duration timeout, Double temperature, Integer maxNewTokens, Boolean returnFullText, Boolean waitForModel)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • HuggingFaceChatModel

      public HuggingFaceChatModel(HuggingFaceChatModel.Builder builder)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • chat

      public dev.langchain4j.model.chat.response.ChatResponse chat(dev.langchain4j.model.chat.request.ChatRequest chatRequest)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      chat in interface dev.langchain4j.model.chat.ChatModel
    • builder

      public static HuggingFaceChatModel.Builder builder()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • withAccessToken

      public static HuggingFaceChatModel withAccessToken(String accessToken)
      Deprecated, for removal: This API element is subject to removal in a future version.