iai-group / DialogueKit

DialogueKit
https://iai-group.github.io/DialogueKit/main/
Apache License 2.0
9 stars 3 forks source link

Typo in platform and dialogue connector? #252

Open NoB0 opened 4 months ago

NoB0 commented 4 months ago

I believe that there are typos related to the display of an agent's utterance.

In platform.py:

@abstractmethod
    def display_agent_utterance(
        self, user_id: str, utterance: Utterance
    ) -> None:
        """Displays an agent utterance.

        Args:
            user_id: User ID.
            utterance: An instance of Utterance.

        Raises:
            NotImplementedError: If the method is not implemented.
        """
        raise NotImplementedError

I think user_id should be replaced by agent_id.

In dialogue_connector.py:

def register_agent_utterance(
        self, annotated_utterance: AnnotatedUtterance
    ) -> None:
        """Registers an annotated utterance from the agent.

        This method takes a AnnotatedUtterance but only a Utterance gets sent to
        the User. The AnnotatedUtterance gets used to store the conversation for
        future reference, and if the Agent wants to end the conversation with
        the _agent.stop_intent Intent, the DialogueConnector will end the
        conversation with the close() method.

        Note:
            If the Intent label is 'EXIT' the DialogueConnector will close. Thus
            it is only the agent that can close the DialogueConnector.

        Args:
            annotated_utterance: Agent utterance.
        """
        self._dialogue_history.add_utterance(annotated_utterance)
        self._platform.display_agent_utterance(
            self._user.id, annotated_utterance
        )
        # TODO: Replace with appropriate intent (make sure all intent schemes
        # have an EXIT intent.)
        if annotated_utterance.intent == self._agent.stop_intent:
            self.close()
        else:
            self._user.receive_utterance(annotated_utterance)

There I think self._platform.display_agent_utterance(self._user.id, annotated_utterance) can be replaced by self._platform.display_agent_utterance(self._agent.id, annotated_utterance)