controller.http_data_formatter

This file contains methods to format data for HTTP requests.

Module Contents

Classes

Attachment

Message

Button

Response

Functions

get_buttons_attachment(→ Attachment)

Creates a list of buttons for each agent's option.

get_movie_message_data(→ Tuple[str, Attachment])

Creates formatted message with movie information and movie image

Attributes

HTTP_OBJECT_MESSAGE

SHORT_ANSWER

controller.http_data_formatter.HTTP_OBJECT_MESSAGE
controller.http_data_formatter.SHORT_ANSWER
class controller.http_data_formatter.Attachment
type: str
payload: Dict[str, Any]
class controller.http_data_formatter.Message
text: str
intent: str
attachments: List[Attachment]
classmethod from_utterance(utterance: dialoguekit.core.Utterance) Message

Converts an utterance to a message.

Parameters:

utterance – An instance of Utterance.

Returns:

An instance of Message.

class controller.http_data_formatter.Button
title: str
payload: str
button_type: str
class controller.http_data_formatter.Response
recipient: str
message: Message
controller.http_data_formatter.get_buttons_attachment(user_options: moviebot.core.core_types.DialogueOptions) Attachment

Creates a list of buttons for each agent’s option.

Parameters:

user_options – Agent’s options

Returns:

List of buttons objects.

controller.http_data_formatter.get_movie_message_data(info: Dict[str, Any]) Tuple[str, Attachment]

Creates formatted message with movie information and movie image attachment.

Parameters:

info – Movie information.

Returns:

Formatted message with movie information and movie image attachment.