dialoguekit.platforms.platform

The Platform facilitates displaying of the conversation.

Classes

Platform

Represents a platform.

Module Contents

class dialoguekit.platforms.platform.Platform(agent_class: Type[dialoguekit.participant.Agent])

Bases: abc.ABC

Represents a platform.

Parameters:

agent_class – The class of the agent.

abstract start() None

Starts the platform.

Raises:

NotImplementedError – If the method is not implemented.

abstract display_agent_utterance(utterance: dialoguekit.core.Utterance, agent_id: str, user_id: str) None

Displays an agent utterance.

Considering that an agent can interact with multiple users, the user_id is provided to identify the recipient.

Parameters:
  • utterance – An instance of Utterance.

  • agent_id – Agent ID.

  • user_id – User ID of the recipient.

Raises:

NotImplementedError – If the method is not implemented.

abstract display_user_utterance(utterance: dialoguekit.core.Utterance, user_id: str) None

Displays a user utterance.

Parameters:
  • utterance – An instance of Utterance.

  • user_id – User ID.

Raises:

NotImplementedError – If the method is not implemented.

get_new_agent() dialoguekit.participant.Agent

Returns a new instance of the agent.

Returns:

Agent.

get_user(user_id: str) dialoguekit.participant.User

Returns the user.

Parameters:

user_id – User ID.

Returns:

User.

connect(user_id: str) None

Connects a user to an agent.

Parameters:

user_id – User ID.

disconnect(user_id: str) None

Disconnects a user from an agent.

Parameters:

user_id – User ID.

message(user_id: str, text: str) None

Gets called every time there is a new user input.

Parameters:
  • user_id – User ID.

  • text – User input.

feedback(user_id: str, utterance_id: str, value: int) None

Gets called every time there is a new utterance feedback.

Parameters:
  • user_id – User ID.

  • utterance_id – Utterance ID.

  • value – Feedback value.