Home / File/ test_standard.py — langchain Source File

test_standard.py — langchain Source File

Architecture documentation for test_standard.py, a python file in the langchain codebase. 6 imports, 0 dependents.

File python LangChainCore Runnables 6 imports 1 classes

Entity Profile

Dependency Diagram

graph LR
  3102beea_11b5_beb9_a505_29b2d7e061c1["test_standard.py"]
  feec1ec4_6917_867b_d228_b134d0ff8099["typing"]
  3102beea_11b5_beb9_a505_29b2d7e061c1 --> feec1ec4_6917_867b_d228_b134d0ff8099
  f69d6389_263d_68a4_7fbf_f14c0602a9ba["pytest"]
  3102beea_11b5_beb9_a505_29b2d7e061c1 --> f69d6389_263d_68a4_7fbf_f14c0602a9ba
  e929cf21_6ab8_6ff3_3765_0d35a099a053["langchain_core.language_models"]
  3102beea_11b5_beb9_a505_29b2d7e061c1 --> e929cf21_6ab8_6ff3_3765_0d35a099a053
  121262a1_0bd6_d637_bce3_307ab6b3ecd4["langchain_core.tools"]
  3102beea_11b5_beb9_a505_29b2d7e061c1 --> 121262a1_0bd6_d637_bce3_307ab6b3ecd4
  664afa6c_e6cb_4097_de9a_324d8f19a165["langchain_tests.integration_tests"]
  3102beea_11b5_beb9_a505_29b2d7e061c1 --> 664afa6c_e6cb_4097_de9a_324d8f19a165
  15101b31_601b_416b_11c8_2c6abc032083["langchain_huggingface"]
  3102beea_11b5_beb9_a505_29b2d7e061c1 --> 15101b31_601b_416b_11c8_2c6abc032083
  style 3102beea_11b5_beb9_a505_29b2d7e061c1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""Standard LangChain interface tests."""

from typing import Any, Literal

import pytest
from langchain_core.language_models import BaseChatModel
from langchain_core.tools import BaseTool
from langchain_tests.integration_tests import ChatModelIntegrationTests

from langchain_huggingface import ChatHuggingFace, HuggingFaceEndpoint


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

Domain

Subdomains

Dependencies

  • langchain_core.language_models
  • langchain_core.tools
  • langchain_huggingface
  • langchain_tests.integration_tests
  • pytest
  • typing

Frequently Asked Questions

What does test_standard.py do?
test_standard.py is a source file in the langchain codebase, written in python. It belongs to the LangChainCore domain, Runnables subdomain.
What does test_standard.py depend on?
test_standard.py imports 6 module(s): langchain_core.language_models, langchain_core.tools, langchain_huggingface, langchain_tests.integration_tests, pytest, typing.
Where is test_standard.py in the architecture?
test_standard.py is located at libs/partners/huggingface/tests/integration_tests/test_standard.py (domain: LangChainCore, subdomain: Runnables, directory: libs/partners/huggingface/tests/integration_tests).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free