code: def _construct_field(
      value: object, field: FieldInfo, key: str
  ) -> object:
      if value is None:
          return field_get_default(field)
  
      if PYDANTIC_V2:
          type_ = field.annotation
      else:
          type_ = cast(type, field.outer_type_)  # type: ignore
  
      if type_ is None:
          raise RuntimeError(f"Unexpected field type is None for {key}")
  
      return construct_type(value=value, type_=type_)
  
imports: from __future__ import annotations
  import inspect
  from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast
  from datetime import date, datetime
  from typing_extensions import Unpack, Literal, ClassVar, Protocol, Required, TypedDict, final, override, runtime_checkable
  import pydantic
  import pydantic.generics
  from pydantic.fields import FieldInfo
  from ._types import Body, IncEx, Query, ModelT, Headers, Timeout, NotGiven, AnyMapping, HttpxRequestFiles
  from ._utils import is_list, is_given, is_mapping, parse_date, parse_datetime, strip_not_given
  from ._compat import PYDANTIC_V2, ConfigDict, GenericModel, get_args, is_union, parse_obj, get_origin, is_literal_type, get_model_config, get_model_fields, field_get_default
  from ._constants import RAW_RESPONSE_HEADER
label_desc: Use image node_id 1 for calling a global function with example usage: _construct_field(value, field, key) and returns: construct_type, field_get_default