From a7e20b315954a2682a8f4cd5032574a7f14f0f37 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 6 Jun 2018 15:17:32 -0700 Subject: [PATCH] Document optional words for conversation --- docs/intent_conversation.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/intent_conversation.md b/docs/intent_conversation.md index f5ddc351..797c8f1d 100644 --- a/docs/intent_conversation.md +++ b/docs/intent_conversation.md @@ -4,16 +4,16 @@ title: "Registering sentences" The conversation component handles incoming commands from the frontend and converts them to intents. It does this based on registered sentences. -As a component, you can register sentences with the conversation component to allow it to be remote controlled. Refer to named slots by putting the slot name between curly braces: `{item}`. +As a component, you can register sentences with the conversation component to allow it to be remote controlled. Refer to named slots by putting the slot name between curly braces: `{item}`. Use square brackets around (partial) words to mark them as optional. Example code: ```python async def async_setup(hass, config): hass.components.conversation.async_register('MyCoolIntent', [ - 'I think that {object} is very cool', + 'I think that {object} is [very] cool', 'Nothing is cooler than {object}' ]) ``` -If a sentence like "I think that beer is very cool" comes in, the conversation component will generate an intent of type `MyCoolIntent` and with 1 slot, named `object` and value `beer`. +If a sentence like "I think that beer is cool" comes in, the conversation component will generate an intent of type `MyCoolIntent` and with 1 slot, named `object` and value `beer`.