class_docstr: This Dataclass is a schema for the nested retrieval config under prompt.
class_docstr_tok: ["This","Dataclass","is","a","schema","for","the","nested","retrieval","config","under","prompt","."]
code: def __post_init__(self):
      # TODO: have a dynamically loaded schema based on the selection of the type param
      # https://github.com/ludwig-ai/ludwig/pull/3351#discussion_r1181910954
      # Ensure k is non-zero if we're using a retrieval strategy
      if self.type is not None and self.k == 0:
          self.k = 1
  
      if self.type is None and self.k != 0:
          raise ConfigValidationError(
              "k must be 0 if retrieval type is None."
          )
      elif self.type is not None and self.k <= 0:
          raise ConfigValidationError(
              "k must be greater than 0 if retrieval type is not None."
          )
  
      if self.type is None and self.model_name is not None:
          raise ConfigValidationError(
              "model_name must be None if retrieval type is None."
          )
      elif self.type == SEMANTIC and self.model_name is None:
          raise ConfigValidationError(
              f"model_name must not be None if retrieval type is '{SEMANTIC}'."
          )
  
file_path: ludwig/ludwig/schema/llms/prompt.py
imports: from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import SEMANTIC
  from ludwig.error import ConfigValidationError
  from ludwig.schema import utils
  from ludwig.schema.metadata import LLM_METADATA
  from ludwig.schema.utils import ludwig_dataclass
label_desc: Use image node_id 1 for calling the RetrievalConfig obj's underlying member method code with example usage: obj.__post_init__() without return types