def importance(self,
                 memory: str,
                 context: Sequence[tuple[str, float]] = ()) -> float:
    """Computes importance of a memory by quering LLM.

    Args:
      memory: memory to compute importance of
      context: a sequence of tuples of (old memory (str), importance
        (float between 0 and 1)) used to provide context and relative scale for
        the decision of the importance of the new memory.

    Returns:
      Value of importance
    """
    zero, *_, one = self._importance_scale
    chain_of_thought = interactive_document.InteractiveDocument(self._model)
    if context:
      context_string = '\n'.join(
          f'{context[0]} -- likely importance to the plot: {context[1]}'
          for context in context)
      chain_of_thought.statement(context_string)
    question = (
        f'You are the game master of a tabletop role-playing game. On a '
        f'scale from {zero} to '
        f'{one}, where {zero} is purely mundane '
        f'(e.g., wind blowing, bus arriving) and {one} is '
        'extremely important (e.g., an earthquake, '
        'the end of a war, a revolution), rate the likely importance of the '
        'following event for advancing the overall plot.\nEvent:'
        + memory
        + '\nRating: ')
    if context is not None:
      question = (
          f'{context}\nRelative to the life memories above, {question}')
    action = chain_of_thought.multiple_choice_question(
        question=question, answers=self._importance_scale)
    return action / len(self._importance_scale)
Computes importance of a memory by quering LLM.

    Args:
      memory: memory to compute importance of
      context: a sequence of tuples of (old memory (str), importance
        (float between 0 and 1)) used to provide context and relative scale for
        the decision of the importance of the new memory.

    Returns:
      Value of importance
    
concordia/associative_memory/deprecated/importance_function.py