Home / Function/ test_json_schema() — langchain Function Reference

test_json_schema() — langchain Function Reference

Architecture documentation for the test_json_schema() function in test_standard.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  49468ec4_ab19_de45_ea96_db8e98d9974e["test_json_schema()"]
  cccb55dd_44c7_c92f_75a0_aa1cc79fdaed["test_standard.py"]
  49468ec4_ab19_de45_ea96_db8e98d9974e -->|defined in| cccb55dd_44c7_c92f_75a0_aa1cc79fdaed
  9f0e1a09_5cde_4010_b9c2_3e791f45b48c["structured_output_kwargs()"]
  49468ec4_ab19_de45_ea96_db8e98d9974e -->|calls| 9f0e1a09_5cde_4010_b9c2_3e791f45b48c
  ddd533e4_7660_0d5b_b909_479972002f4b["chat_model_class()"]
  49468ec4_ab19_de45_ea96_db8e98d9974e -->|calls| ddd533e4_7660_0d5b_b909_479972002f4b
  08b5a74c_685d_0964_a465_90c76dc2612d["chat_model_params()"]
  49468ec4_ab19_de45_ea96_db8e98d9974e -->|calls| 08b5a74c_685d_0964_a465_90c76dc2612d
  style 49468ec4_ab19_de45_ea96_db8e98d9974e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/groq/tests/integration_tests/test_standard.py lines 54–72

def test_json_schema(
    schema_type: Literal["pydantic", "typeddict", "json_schema"],
) -> None:
    class JsonSchemaTests(ChatModelIntegrationTests):
        @property
        def chat_model_class(self) -> type[ChatGroq]:
            return ChatGroq

        @property
        def chat_model_params(self) -> dict:
            return {"model": "openai/gpt-oss-120b", "rate_limiter": rate_limiter}

        @property
        def structured_output_kwargs(self) -> dict:
            return {"method": "json_schema"}

    test_instance = JsonSchemaTests()
    model = test_instance.chat_model_class(**test_instance.chat_model_params)
    JsonSchemaTests().test_structured_output(model, schema_type)

Domain

Subdomains

Frequently Asked Questions

What does test_json_schema() do?
test_json_schema() is a function in the langchain codebase, defined in libs/partners/groq/tests/integration_tests/test_standard.py.
Where is test_json_schema() defined?
test_json_schema() is defined in libs/partners/groq/tests/integration_tests/test_standard.py at line 54.
What does test_json_schema() call?
test_json_schema() calls 3 function(s): chat_model_class, chat_model_params, structured_output_kwargs.

Analyze Your Own Codebase

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

Try Supermodel Free