dialoguekit.connector.dialogue_connector

Central broker for coordinating the communication between Agent and User.

The DialogueConnector is instantiated with an Agent and a User. These are then connected with the particular DialogueConnector instance by calling their respective connect_dialogue_connector() methods.

By definition, the communication starts with the Agent’s welcome message. Each agent/user utterance is sent to the other party via their respective receive_utterance() methods. It is left to to specific Agent and User instances when and how they respond. It is expected that most will respond immediately upon receiving an utterance, but this is not required. Whenever there is a message from either the Agent or the User, the DialogueConnector sends it to the other party by calling their receive_{agent/user}_utterance() method.

Classes

DialogueConnector

Represents a dialogue connector.

Module Contents

class dialoguekit.connector.dialogue_connector.DialogueConnector(agent: dialoguekit.participant.agent.Agent, user: dialoguekit.participant.user.User, platform: dialoguekit.platforms.platform.Platform, conversation_id: str = None, save_dialogue_history: bool = True)

Represents a dialogue connector.

Parameters:
  • agent – An instance of Agent.

  • user – An instance of User.

  • platform – An instance of Platform.

  • conversation_id – Conversation ID. Defaults to None.

  • save_dialogue_history – Flag to save the dialogue or not.

property dialogue_history
Return the dialogue history.
get_platform() dialoguekit.platforms.platform.Platform

Returns the platform.

register_user_utterance(annotated_utterance: dialoguekit.core.annotated_utterance.AnnotatedUtterance) None

Registers an annotated utterance from the user.

In most cases the Agent should not know about the Users Intent and Annotation-s. But for some use cases this additional information may become useful, depending on the UI etc. Thus the complete AnnotatedUtterance will be sent to the Agent. It is the Agents responsibility to only use the information it is supposed to.

Parameters:

annotated_utterance – User utterance.

register_agent_utterance(annotated_utterance: dialoguekit.core.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.

Parameters:

annotated_utterance – Agent utterance.

register_user_feedback(feedback: dialoguekit.core.feedback.BinaryFeedback, utterance_id: str) None

Registers user’s feedback for a utterance from dialogue history.

Parameters:
  • feedback – User’s feedback (BinaryFeedback.{NEGATIVE|POSITIVE}) for a utterance.

  • utterance_id – Utterance ID.

start() None

Starts the conversation.

close() None

Closes the conversation.

If ‘_save_dialogue_history’ is set to True it will export the dialogue history.