Slot Responses#
Slot-related responses.
- class FilledTemplate(**data)[source]#
Bases:
BaseResponse
Fill template with slot values. The text attribute of the template message should be a format-string: e.g. “Your username is {profile.username}”.
For the example above, if
profile.username
slot has value “admin”, it would return a copy of the message with the following text: “Your username is admin”.-
template:
Union
[Message
,dict
[dict
],str
[str
],BaseResponse
]# A response to use as a template.
-
on_exception:
Literal
['keep_template'
,'return_none'
]# What to do if template filling fails.
“keep_template”:
template
is returned, unfilled.“return_none”: an empty message is returned.
- classmethod validate_template(template)[source]#
- Return type:
Union
[ConstResponse
,BaseResponse
]
-
template: