# is_pydantic_v2_subclass

> **Function** in `langchain_core`

📖 [View in docs](https://reference.langchain.com/python/langchain-core/utils/pydantic/is_pydantic_v2_subclass)

Check if the given class is Pydantic v2-like.

## Signature

```python
is_pydantic_v2_subclass(
    cls: type,
) -> TypeGuard[type[BaseModel]]
```

## Returns

`TypeGuard[type[BaseModel]]`

`True` if the given class is a subclass of Pydantic `BaseModel` 2.x.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/5069b326c53069ec85a7e1d914c6873feb8d0cfa/libs/core/langchain_core/utils/pydantic.py#L88)