code: def pydantic_components_schema(
      pydantic_model: type[pydantic.BaseModel],
  ):
      if pkg_version_info("pydantic")[0] >= 2:
          return pydantic_v2_components_schema(pydantic_model)
      else:
          return pydantic_v1_components_schema(pydantic_model)
  
file_path: BentoML/src/bentoml/_internal/service/openapi/utils.py
imports: from __future__ import annotations
  import typing
  from functools import lru_cache
  from typing import TYPE_CHECKING
  from bentoml.exceptions import InternalServerError
  from bentoml.exceptions import InvalidArgument
  from bentoml.exceptions import NotFound
  from ...utils import LazyLoader
  from ...utils.pkg import pkg_version_info
  from .specification import Schema
label_desc: Use image node_id 1 for calling a global function with example usage: pydantic_components_schema(pydantic_model) and returns: pydantic_v2_components_schema, pydantic_v1_components_schema