code: def generate_field_text(
      field_name: str,
      field_type: Type[Any],
      model: Type[BaseModel],
      depth=1,
      documentation_with_field_description=True,
  ) -> str:
      """
      Generate text documentation for a Pydantic model field.
  
      Args:
          field_name (str): Name of the field.
          field_type (Type[Any]): Type of the field.
          model (Type[BaseModel]): Pydantic model class.
          depth (int): Indentation depth in the documentation.
          documentation_with_field_description (bool): Include field descriptions in the documentation.
  
      Returns:
          str: Generated text documentation for the field.
      """
      indent = "    " * depth
  
      field_info = model.model_fields.get(field_name)
      field_description = (
          field_info.description
          if field_info and field_info.description
          else ""
      )
  
      if get_origin(field_type) == list:
          element_type = get_args(field_type)[0]
          field_text = f"{indent}{field_name} ({format_model_and_field_name(field_type.__name__)} of {format_model_and_field_name(element_type.__name__)})"
          if field_description != "":
              field_text += ":\n"
          else:
              field_text += "\n"
      elif get_origin(field_type) == Union:
          element_types = get_args(field_type)
          types = []
          for element_type in element_types:
              types.append(
                  format_model_and_field_name(element_type.__name__)
              )
          field_text = f"{indent}{field_name} ({' or '.join(types)})"
          if field_description != "":
              field_text += ":\n"
          else:
              field_text += "\n"
      else:
          field_text = f"{indent}{field_name} ({format_model_and_field_name(field_type.__name__)})"
          if field_description != "":
              field_text += ":\n"
          else:
              field_text += "\n"
  
      if not documentation_with_field_description:
          return field_text
  
      if field_description != "":
          field_text += (
              f"{indent}  Description: " + field_description + "\n"
          )
  
      # Check for and include field-specific examples if available
      if (
          hasattr(model, "Config")
          and hasattr(model.Config, "json_schema_extra")
          and "example" in model.Config.json_schema_extra
      ):
          field_example = model.Config.json_schema_extra["example"].get(
              field_name
          )
          if field_example is not None:
              example_text = (
                  f"'{field_example}'"
                  if isinstance(field_example, str)
                  else field_example
              )
              field_text += f"{indent}  Example: {example_text}\n"
  
      if isclass(field_type) and issubclass(field_type, BaseModel):
          field_text += f"{indent}  Details:\n"
          for name, type_ in field_type.__annotations__.items():
              field_text += generate_field_text(
                  name, type_, field_type, depth + 2
              )
  
      return field_text
  
imports: import inspect
  import json
  from copy import copy
  from inspect import isclass, getdoc
  from types import NoneType
  from docstring_parser import parse
  from pydantic import BaseModel, create_model, Field
  from typing import Any, Type, List, get_args, get_origin, Tuple, Union, Optional, _GenericAlias
  from enum import Enum
  from typing import get_type_hints, Callable
  import re
  from enum import Enum
label_desc: Use image node_id 16 for calling a global function with example usage: generate_field_text(field_name, field_type, model, depth, documentation_with_field_description) and returns: field_text, field_text