Class HuggingFaceChatModel
java.lang.Object
dev.langchain4j.model.huggingface.HuggingFaceChatModel
- All Implemented Interfaces:
ChatModel
@Deprecated(forRemoval=true,
since="1.7.0-beta13")
public class HuggingFaceChatModel
extends Object
implements ChatModel
Deprecated, for removal: This API element is subject to removal in a future version.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDeprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, 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 TypeMethodDescriptionstatic HuggingFaceChatModel.Builderbuilder()Deprecated, for removal: This API element is subject to removal in a future version.chat(ChatRequest chatRequest) Deprecated, for removal: This API element is subject to removal in a future version.This is the main API to interact with the chat model.static HuggingFaceChatModelwithAccessToken(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, waitMethods inherited from interface ChatModel
chat, chat, chat, defaultRequestParameters, doChat, listeners, provider, supportedCapabilities
-
Constructor Details
-
HuggingFaceChatModel
-
HuggingFaceChatModel
-
HuggingFaceChatModel
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
chat
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ChatModelThis is the main API to interact with the chat model.- Specified by:
chatin interfaceChatModel- Parameters:
chatRequest- aChatRequest, containing all the inputs to the LLM- Returns:
- a
ChatResponse, containing all the outputs from the LLM
-
builder
Deprecated, for removal: This API element is subject to removal in a future version. -
withAccessToken
Deprecated, for removal: This API element is subject to removal in a future version.
-
OpenAiChatModelfrom thelangchain4j-open-aimodule instead:ChatModel model = OpenAiChatModel.builder() .apiKey(System.getenv("HF_API_KEY")) .baseUrl("https://router.huggingface.co/v1") .modelName("HuggingFaceTB/SmolLM3-3B:hf-inference") .build();