TestHuggingFaceEndpoint Class — langchain Architecture
Architecture documentation for the TestHuggingFaceEndpoint class in test_standard.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD cd007332_e9cb_34d2_f02c_d0d938bf994b["TestHuggingFaceEndpoint"] 971e928f_9c9b_ce7a_b93d_e762f2f5aa54["ChatModelIntegrationTests"] cd007332_e9cb_34d2_f02c_d0d938bf994b -->|extends| 971e928f_9c9b_ce7a_b93d_e762f2f5aa54 3102beea_11b5_beb9_a505_29b2d7e061c1["test_standard.py"] cd007332_e9cb_34d2_f02c_d0d938bf994b -->|defined in| 3102beea_11b5_beb9_a505_29b2d7e061c1 c13995ed_e150_9243_e79c_66e937757eac["chat_model_class()"] cd007332_e9cb_34d2_f02c_d0d938bf994b -->|method| c13995ed_e150_9243_e79c_66e937757eac bec12f57_3433_282d_98bc_c4655ddb8ec7["chat_model_params()"] cd007332_e9cb_34d2_f02c_d0d938bf994b -->|method| bec12f57_3433_282d_98bc_c4655ddb8ec7 374bb899_687c_8cbb_cbbc_a831ffab284c["model()"] cd007332_e9cb_34d2_f02c_d0d938bf994b -->|method| 374bb899_687c_8cbb_cbbc_a831ffab284c d9e8926a_ba98_edea_7e3c_5f04e6a32fbe["test_structured_output()"] cd007332_e9cb_34d2_f02c_d0d938bf994b -->|method| d9e8926a_ba98_edea_7e3c_5f04e6a32fbe e225924d_c52b_5e53_ecea_72cc427d6b87["test_structured_output_async()"] cd007332_e9cb_34d2_f02c_d0d938bf994b -->|method| e225924d_c52b_5e53_ecea_72cc427d6b87 26b87fd1_07e7_de2a_6479_cbb40c81e234["test_structured_output_pydantic_2_v1()"] cd007332_e9cb_34d2_f02c_d0d938bf994b -->|method| 26b87fd1_07e7_de2a_6479_cbb40c81e234 c3625bfb_dfe4_8086_857f_477bc7a5cb9d["test_structured_output_optional_param()"] cd007332_e9cb_34d2_f02c_d0d938bf994b -->|method| c3625bfb_dfe4_8086_857f_477bc7a5cb9d bd69217e_199b_9629_d4f8_dbefe6532e50["test_tool_message_histories_list_content()"] cd007332_e9cb_34d2_f02c_d0d938bf994b -->|method| bd69217e_199b_9629_d4f8_dbefe6532e50 0c4ad5fe_0850_d880_bf99_6c5f5a69e9e7["has_tool_choice()"] cd007332_e9cb_34d2_f02c_d0d938bf994b -->|method| 0c4ad5fe_0850_d880_bf99_6c5f5a69e9e7
Relationship Graph
Source Code
libs/partners/huggingface/tests/integration_tests/test_standard.py lines 13–72
class TestHuggingFaceEndpoint(ChatModelIntegrationTests):
@property
def chat_model_class(self) -> type[BaseChatModel]:
return ChatHuggingFace
@property
def chat_model_params(self) -> dict:
llm = HuggingFaceEndpoint( # type: ignore[call-arg]
repo_id="meta-llama/Llama-4-Maverick-17B-128E-Instruct",
task="conversational",
provider="fireworks-ai",
temperature=0,
)
return {"llm": llm}
@pytest.fixture
def model(self, request: Any) -> BaseChatModel:
return self.chat_model_class(**self.chat_model_params) # type: ignore[call-arg]
@pytest.mark.xfail(
reason=("Overrding, testing only typed dict and json schema structured output")
)
@pytest.mark.parametrize("schema_type", ["typeddict", "json_schema"])
def test_structured_output(
self,
model: BaseChatModel,
schema_type: Literal["pydantic", "typeddict", "json_schema"],
) -> None:
super().test_structured_output(model, schema_type)
@pytest.mark.xfail(
reason=("Overrding, testing only typed dict and json schema structured output")
)
@pytest.mark.parametrize("schema_type", ["typeddict", "json_schema"])
async def test_structured_output_async(
self,
model: BaseChatModel,
schema_type: Literal["pydantic", "typeddict", "json_schema"],
) -> None:
super().test_structured_output(model, schema_type)
@pytest.mark.xfail(reason=("Pydantic structured output is not supported"))
def test_structured_output_pydantic_2_v1(self, model: BaseChatModel) -> None:
super().test_structured_output_pydantic_2_v1(model)
@pytest.mark.xfail(reason=("Pydantic structured output is not supported"))
def test_structured_output_optional_param(self, model: BaseChatModel) -> None:
super().test_structured_output_optional_param(model)
@pytest.mark.xfail(reason=("Not implemented"))
def test_tool_message_histories_list_content(
self, model: BaseChatModel, my_adder_tool: BaseTool
) -> None:
super().test_tool_message_histories_list_content(
model, my_adder_tool=my_adder_tool
)
@property
def has_tool_choice(self) -> bool:
return False
Extends
Source
Frequently Asked Questions
What is the TestHuggingFaceEndpoint class?
TestHuggingFaceEndpoint is a class in the langchain codebase, defined in libs/partners/huggingface/tests/integration_tests/test_standard.py.
Where is TestHuggingFaceEndpoint defined?
TestHuggingFaceEndpoint is defined in libs/partners/huggingface/tests/integration_tests/test_standard.py at line 13.
What does TestHuggingFaceEndpoint extend?
TestHuggingFaceEndpoint extends ChatModelIntegrationTests.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free