def augment_exemplars(example: RawExample, exemplars: Sequence[RawExample],
                      funcall_format: str,
                      config: FormatterConfig) -> Tuple[str, str]:
  """Generates (input, output) pair where the input is retrieval-augmented.

  Args:
    example: Original RawExample.
    exemplars: List of exemplars to augment.
    funcall_format: Format of the output function call or logical form.
    config: a FormatterConfig object.

  Returns:
    Tuple (input string, output string).
  """
  orig_input = example["input_str"]
  orig_output = example["output_str"]
  exemplar_inputs = [exemplar["input_str"] for exemplar in exemplars]
  exemplar_outputs = [exemplar["output_str"] for exemplar in exemplars]

  # Process the funcalls.
  funcall_processor = _FUNCALL_PROCESSOR[funcall_format]
  exemplar_outputs, orig_output = funcall_processor(exemplar_outputs,
                                                    orig_output, config)
  input_str = format_prompt(orig_input, exemplar_inputs, exemplar_outputs,
                            config)
  return input_str, orig_output
Generates (input, output) pair where the input is retrieval-augmented.

  Args:
    example: Original RawExample.
    exemplars: List of exemplars to augment.
    funcall_format: Format of the output function call or logical form.
    config: a FormatterConfig object.

  Returns:
    Tuple (input string, output string).
  
language/casper/augment/casper_formatters.py