Buttons

Beside universal and customizable frontend for Watoson Assistant, clientv2 is also a prototyping platform. It is a place where we quickly implement and test various ideas to improve chatbot development experience.

There are 3 coexisting ways of providing user with quick response buttons implemented so far:

Response options

Response options i a method addressing multimodality. It is tightly coupled with frames feature of WA (Watson Assistant). WA generates output.response_options field automatically whenever a frame is focused. Responses are meant to be drawn from possible values of the entity associated with every slot. However, this was never fully implemented and clientv2 supports only entities color and size with hardcoded values.

output.response_options format

{
	output: {
			response_options: [
				{
					label: string,    // title of the slot
					variable: string, // name of the entity and destination context variable
					type: "enum", "number", "date" // not used in the implementation
					options: [
						{
							label: string,      // Text on the button
							value: string,      // Value assigned to the context variable when clicked
							input_text: string  // Text sent as input to WA when cliecked
						}
					]
				}
			]
		}
	}
}

Preview

Response options preview

Suggestions

Suggestions are generated automatically by a suggestion service or manually defined in a conversation node. ClientV2 can be confiured to call a suggestions service by suggestion_service key:

"suggestion_service": {
	"url": "https://suggestion-service.mybluemix.net",
	"count": 3 // number of suggestions to generate
}

The suggestion service generates suggestions from logs and from the structure of the workspace.

Suggestions format

{
	output: {
			suggestions: [
				{
					label: string,  // Text on the button
					value: string,  // Text sent as input to WA when cliecked
				}
			]
		}
	}
}

Preview

Response options preview

Conflict with generic response types

Until complete implementation of generic response types, suggestions were using the output.generic field with response type option. After the implementation, content of output.generic field is rendered in typed blocks according to principles of generic response types. The resulting appearance of the dialog will differ in new versions of clientv2 if the workspace is using output.generic for suggestions. See the previews.

Generic response type - options

Generic response types allow to build response form blocks of various modality.

Format

{
	"output": {
		"generic": [
			{
				"response_type": "option",
				"title": string,
                "description": string,
                "options": [
                    {
                        "label": string,
                        "value": {
                            "input": {
                                "text": string
                            }
                        }
                    }
                ],
				
			}
		]
	}
}

Preview

Response type option preview