def _add_components_if_any(
      self,
      chain_of_thought: interactive_document.InteractiveDocument,
  ) -> None:
    """Adds components to the chain of thought if any are present."""
    if self._components:
      component_states = '\n'.join([
          f'{prefix}:\n{self.get_named_component_pre_act_value(key)}'
          for key, prefix in self._components.items()
      ])
      chain_of_thought.statement(f'Considerations:\n{component_states}\n')
Adds components to the chain of thought if any are present.
concordia/contrib/components/agent/deprecated/situation_representation_via_narrative.py