deeppavlov.agents.rich_content¶
Rich content support implemented for various channels.
-
class
deeppavlov.agents.rich_content.default_rich_content.
Button
(name: str, callback: str)[source]¶ Button with plain text callback.
Parameters: - name – Displayed name of the button.
- callback – Plain text returned as callback when button pressed.
-
name
¶ Displayed name of the button.
-
callback
¶ Plain text returned as callback when button pressed.
-
class
deeppavlov.agents.rich_content.default_rich_content.
ButtonsFrame
(text: Optional[str] = None)[source]¶ ButtonsFrame is a container for several Buttons objects.
ButtonsFrame embeds several Buttons and allows to post them in one channel message.
Parameters: text – Text displayed with embedded buttons. -
text
¶ Text displayed with embedded buttons.
-
content
¶ Container with Button objects.
Adds Button instance to RichMessage.
Parameters: button – Button instance.
-
json
() → dict[source]¶ Returns json compatible state of the ButtonsFrame instance.
Returns json compatible state of the ButtonsFrame instance including all nested buttons.
Returns: Json representation of ButtonsFrame state. Return type: control_json
-
ms_bot_framework
() → dict[source]¶ Returns MS Bot Framework compatible state of the ButtonsFrame instance.
Creating MS Bot Framework activity blank with RichCard in “attachments”. RichCard is populated with CardActions corresponding buttons embedded in ButtonsFrame.
Returns: MS Bot Framework representation of ButtonsFrame state. Return type: control_json
-
-
class
deeppavlov.agents.rich_content.default_rich_content.
PlainText
(text: str)[source]¶ Plain text message as a rich control.
Parameters: text – Text of the message. -
content
¶ Text of the message.
-