From 41f7620989a23cb481a34db9abf64721116e3f74 Mon Sep 17 00:00:00 2001 From: Leonid Ganeline Date: Thu, 20 Jun 2024 06:22:40 -0700 Subject: [PATCH] huggingface: docstrings (#23148) Added missed docstrings. Format docstrings to the consistent format (used in the API Reference) Co-authored-by: ccurme --- .../langchain_huggingface/chat_models/huggingface.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/partners/huggingface/langchain_huggingface/chat_models/huggingface.py b/libs/partners/huggingface/langchain_huggingface/chat_models/huggingface.py index 3399715f82..23c3165509 100644 --- a/libs/partners/huggingface/langchain_huggingface/chat_models/huggingface.py +++ b/libs/partners/huggingface/langchain_huggingface/chat_models/huggingface.py @@ -42,12 +42,16 @@ DEFAULT_SYSTEM_PROMPT = """You are a helpful, respectful, and honest assistant." @dataclass class TGI_RESPONSE: + """Response from the TextGenInference API.""" + choices: List[Any] usage: Dict @dataclass class TGI_MESSAGE: + """Message to send to the TextGenInference API.""" + role: str content: str tool_calls: List[Dict] @@ -141,8 +145,7 @@ def _is_huggingface_pipeline(llm: Any) -> bool: class ChatHuggingFace(BaseChatModel): - """ - Wrapper for using Hugging Face LLM's as ChatModels. + """Hugging Face LLM's as ChatModels. Works with `HuggingFaceTextGenInference`, `HuggingFaceEndpoint`, `HuggingFaceHub`, and `HuggingFacePipeline` LLMs.