code: def check_prompt_requirements(
      config: "ModelConfig",
  ) -> None:  # noqa: F821
      """Checks that prompt's template and task properties are valid, according to the description on the schema."""
      if config.model_type != MODEL_LLM:
          return
  
      # TODO: `prompt` by default should be set to null, not a default dict:
      # # If no prompt is provided, no validation necessary:
      # if not config.prompt:
      #     return
      from ludwig.schema.llms.prompt import (
          PromptConfig,
          RetrievalConfig,
      )
  
      if config.prompt == PromptConfig():
          return
  
      template = config.prompt.template
      task = config.prompt.task
      retrieval = config.prompt.retrieval
  
      # If template is NOT provided, then task is required for zero/few shot learning:
      if not template and not task:
          raise ConfigValidationError(
              "A prompt task is required if no template is provided!"
          )
  
      template_refs = (
          set(findall(r"\{(.*?)\}", template))
          if isinstance(template, str)
          else set()
      )
  
      # If a template IS provided (i.e. we are not doing a built-in zero/few-shot learning), then...
      if template:
          # If task is also provided, the template must contain it:
          if task and "__task__" not in template_refs:
              raise ConfigValidationError(
                  "When providing a task, you must make sure that the task keyword `{__task__} is "
                  "present somewhere in the template string!"
              )
  
          # If retrieval is also provided, the template must reference it:
          # TODO: retrieval by default should be set to null, not a default dict:
          if (
              retrieval
              and retrieval != RetrievalConfig()
              and "__context__" not in template_refs
          ):
              raise ConfigValidationError(
                  "When providing a retrieval config, you must make sure that the task keyword `{__context__}` is "
                  "present somewhere in the template string!"
              )
  
          # Otherwise, the template should at least contain the sample keyword or some input column:
          # TODO: len(template_refs) is a hacky attempt to check that there are references to *something* in the
          # string. The proper validation is to check the references against the features in the user's dataset - but we
          # do not have access to the dataset in this code path right now.
          if not task:
              if (
                  len(template_refs) == 0
                  and "__sample__" not in template_refs
              ):
                  raise ConfigValidationError(
                      "A template must contain at least one reference to a column or the sample keyword {__sample__} for "
                      "a JSON-serialized representation of non-output feature columns."
                  )
  
          # Raise an error if template has a placeholder for the output feature name (column).
          output_feature_col = config.output_features[0].column
          if output_feature_col in template_refs:
              raise ConfigValidationError(
                  "Prompt template should not have a reference to the output feature. The output feature is "
                  "automatically added to the end of the prompt template merged with the input at training time."
              )
  
imports: from abc import ABC, abstractmethod
  from re import findall
  from typing import Callable, TYPE_CHECKING
  from transformers import AutoConfig
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import AUDIO, BINARY, CATEGORY, IMAGE, IN_MEMORY, MIN_QUANTIZATION_BITS_FOR_MERGE_AND_UNLOAD, MODEL_ECD, MODEL_GBM, MODEL_LLM, NUMBER, SEQUENCE, SET, TEXT, TIMESERIES, VECTOR
  from ludwig.error import ConfigValidationError
  from ludwig.utils.metric_utils import get_feature_to_metric_names_map_from_feature_collection
  from ludwig.utils.misc_utils import merge_dict
label_desc: Use image node_id 35 for calling a global function with example usage: check_prompt_requirements(config) without return types