def action_spec_to_string(action_spec: entity_lib.ActionSpec) -> str:
  """Convert an action spec to a string."""
  if action_spec.output_type == entity_lib.OutputType.FREE:
    return f'prompt: {action_spec.call_to_action};;type: free'
  elif action_spec.output_type == entity_lib.OutputType.CHOICE:
    return (
        f'prompt: {action_spec.call_to_action};;type: choice options: '
        + ', '.join(action_spec.options)
    )
  elif action_spec.output_type == entity_lib.OutputType.SKIP_THIS_STEP:
    return f'prompt: {action_spec.call_to_action};;{_TYPE_SKIP_THIS_STEP}'
  else:
    raise RuntimeError(
        'Invalid action spec output type: \"{}\"'.format(
            action_spec.output_type))
Convert an action spec to a string.
concordia/environment/engine.py