test_with_field_metadata() — langchain Function Reference
Architecture documentation for the test_with_field_metadata() function in test_pydantic.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD f28f2263_faab_5baa_e7dc_fbd5e67596a9["test_with_field_metadata()"] f94b56e0_336c_6748_3628_73edd4212b01["test_pydantic.py"] f28f2263_faab_5baa_e7dc_fbd5e67596a9 -->|defined in| f94b56e0_336c_6748_3628_73edd4212b01 style f28f2263_faab_5baa_e7dc_fbd5e67596a9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/utils/test_pydantic.py lines 110–133
def test_with_field_metadata() -> None:
"""Test pydantic with field metadata."""
class Foo(BaseModel):
x: list[int] = Field(
description="List of integers", min_length=10, max_length=15
)
subset_model = _create_subset_model_v2("Foo", Foo, ["x"])
assert subset_model.model_json_schema() == {
"properties": {
"x": {
"description": "List of integers",
"items": {"type": "integer"},
"maxItems": 15,
"minItems": 10,
"title": "X",
"type": "array",
}
},
"required": ["x"],
"title": "Foo",
"type": "object",
}
Domain
Subdomains
Source
Frequently Asked Questions
What does test_with_field_metadata() do?
test_with_field_metadata() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/utils/test_pydantic.py.
Where is test_with_field_metadata() defined?
test_with_field_metadata() is defined in libs/core/tests/unit_tests/utils/test_pydantic.py at line 110.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free