Identifies contact details from the users utterances for easy form filling.
This configuration demonstrates how to implement a simple contact form that can be filled by using voice.
It defines five entities (name
, street_address
, email_address
, phone_number
and dob
) that are all implemented using our standard variables. The idea is to assign each of these entities to a different field in a form. The CodePen demo related to this configuration does this simply by using the name of the entity as the identifier of the form component, to which the entity value is written.
The configuration supports utterances such as
Things to note:
phrases
. The last line, $phrases {{and} $phrases}
defines that a single utterance can consist of up to two of these phrases spoken one after the other. (Optionally with the word “and” in between.)phrases = [
*fill [{[my | the]} name {is} | i'm | i am] $SPEECHLY.PERSON_NAME(name)
*fill [{[my | the]} address {is} | i live at] $SPEECHLY.STREET_ADDRESS(street_address)
*fill {[my | the]} email {is} $SPEECHLY.EMAIL_ADDRESS(email_address)
*fill {[my | the]} phone {number} {is} $SPEECHLY.PHONE_NUMBER(phone_number)
*fill [{[my | the]} [birthday | date of birth] {is} | i was born on {the}] $SPEECHLY.DATE(dob)
]
$phrases {{and} $phrases}
App ID
from the headerhttps://github.com/speechly/speechly/tree/main/templates/contact-form
npx degit speechly/speechly/templates/contact-form my-app
cd my-app
// Add your App ID into index.js
npm install
npm start
Paste App ID
into the CodePen
Last updated by Mathias Lindholm on March 17, 2022 at 15:02 +0200
Found an error on our documentation? Please file an issue or make a pull request