type: meya.facebook.wit.component.ask.form
class: WitAskFormComponent
path: /meya/facebook/wit/component/ask/form.py
signature: expect, ask_form
Fields
field | signature | required | type | default | description |
---|---|---|---|---|---|
spec | ○ | ○ | Spec | null | Override the original spec for this element |
integration | ○ | ◉ | WitIntegrationRef | ||
intent | ○ | ○ | NoneType | null | Intent or list of intents expected to fire trigger |
intent_regex | ○ | ○ | str | null | Intent regex expected to fire trigger |
min_confidence | ○ | ○ | Real | 0.75 | Minimum confidence in order to fire trigger |
max_confidence | ○ | ○ | Real | 1.0 | Maximum confidence in order to fire trigger |
locale | ○ | ○ | str | null | The first 2 letters must be a valid ISO639-1 language, followed by an underscore, followed by a valid ISO3166 alpha2 country code. Locale is used to resolve the entities. |
coords | ○ | ○ | WitContextCoords | null | Coordinates of the user. Must be in the form of an object with 'lat': float and 'long': float. This field is used to improve ranking for wit/location's resolved values |
timezone | ○ | ○ | Timezone | null | Must be a valid IANA timezone. Used only if no reference_time is provided. Example: 'America/Los_Angeles' |
reference_time | ○ | ○ | str | null | Local date and time of the user in ISO8601 format. Do not use UTC time |
context | ○ | ○ | dict | {} | Send context data with this component's event |
sensitive | ○ | ○ | bool | false | Mark this component's event as sensitive |
triggers | ○ | ○ | list | [] | Activate these dynamic triggers when the component runs |
quick_replies | ○ | ○ | list | [] | List of buttons that the user can select for replies |
composer | ○ | ○ | ComposerElementSpec | focus: blur | |
header | ○ | ○ | HeaderElementSpec | buttons: | Override the header for this component |
markdown | ○ | ○ | list | null | Override the bot Markdown mode for this component |
expect | ◉ | ○ | Expect | null | |
ask_form | ◉ | ○ | str | null | Phrase to be sent to Wit AI for intent detection |
icon | ○ | ○ | IconElementSpec | null | Icon will be shown on field left side |
label | ○ | ○ | str | "Text" | This text will be shown on top left of the form field |
field_name | ○ | ○ | str | "text" | |
autocomplete | ○ | ○ | str | "off" | |
placeholder | ○ | ○ | str | null | |
retries | ○ | ○ | Real | "inf" | |
error_message | ○ | ○ | str | "Invalid" |
Examples
Basic
triggers:
- keyword: meya.facebook.wit.component.ask.form
steps:
- integration: integration.wit
expect: wit
ask_form: STRING
Full
triggers:
- keyword: meya.facebook.wit.component.ask.form
steps:
- spec:
type: STRING
data:
STRING: ANY
timeout: 123
trigger_when: ANY
integration: integration.wit
intent: STRING
intent_regex: STRING
min_confidence: 123
max_confidence: 123
locale: STRING
coords:
lat: 123
long: 123
timezone: TIMEZONE
reference_time: STRING
context:
STRING: ANY
sensitive: false
triggers:
- type: STRING
data:
STRING: ANY
timeout: 123
trigger_when: ANY
quick_replies:
- url: STRING
javascript: STRING
button_id: STRING
context:
STRING: ANY
default: false
disabled: false
divider: false
icon:
url: STRING
color: STRING
path: STRING
action: COMPONENT
value: ANY
result: ANY
data:
STRING: ANY
magic: false
type: text|url|static|menu|divider|action|flow_next|component_next
menu:
- BUTTONELEMENTSPEC
text: STRING
composer:
focus: file|image|text|blur
placeholder: STRING
collapse_placeholder: STRING
visibility: collapse|hide|show
header:
buttons:
- url: STRING
javascript: STRING
button_id: STRING
context:
STRING: ANY
default: false
disabled: false
divider: false
icon:
url: STRING
color: STRING
path: STRING
action: COMPONENT
value: ANY
result: ANY
data:
STRING: ANY
magic: false
type: text|url|static|menu|divider|action|flow_next|component_next
menu:
- BUTTONELEMENTSPEC
text: STRING
title:
text: STRING
icon:
url: STRING
color: STRING
path: STRING
progress:
value: 123
show_percent: false
milestones:
- text: STRING
current: false
extra_buttons:
- url: STRING
javascript: STRING
button_id: STRING
context:
STRING: ANY
default: false
disabled: false
divider: false
icon:
url: STRING
color: STRING
path: STRING
action: COMPONENT
value: ANY
result: ANY
data:
STRING: ANY
magic: false
type: text|url|static|menu|divider|action|flow_next|component_next
menu:
- BUTTONELEMENTSPEC
text: STRING
markdown:
- format|linkify|breaks|typographer
expect: wit
ask_form: STRING
icon:
url: STRING
color: STRING
path: STRING
label: STRING
field_name: STRING
autocomplete: STRING
placeholder: STRING
retries: 123
error_message: STRING