code: def check_generation_params(
      kwargs: Optional[Dict[str, Any]],
      additional_accepted_params: Optional[List[str]] = None,
  ):
      """
      Check the provided generation parameters for validity.
  
      :param kwargs: A dictionary containing the generation parameters.
      :param additional_accepted_params: An optional list of strings representing additional accepted parameters.
      :raises ValueError: If any unknown text generation parameters are provided.
      """
      transformers_import.check()
  
      if kwargs:
          accepted_params = {
              param
              for param in inspect.signature(
                  InferenceClient.text_generation
              ).parameters.keys()
              if param not in ["self", "prompt"]
          }
          if additional_accepted_params:
              accepted_params.update(additional_accepted_params)
          unknown_params = set(kwargs.keys()) - accepted_params
          if unknown_params:
              raise ValueError(
                  f"Unknown text generation parameters: {unknown_params}. The valid parameters are: {accepted_params}."
              )
  
imports: import inspect
  from typing import Any, Dict, List, Optional, Union
  from haystack.lazy_imports import LazyImport
label_desc: Use image node_id 1 for calling a global function with example usage: check_generation_params(kwargs, additional_accepted_params) without return types