Coder Social home page Coder Social logo

zef-dev / convoworks-core Goto Github PK

View Code? Open in Web Editor NEW
23.0 7.0 2.0 1.67 MB

PHP framework for handling conversational services like Amazon Alexa skills, Google Assistant, Viber, FB messenger ...

Home Page: https://convoworks.com

License: MIT License

PHP 92.81% HTML 7.19%
opensource amazon-alexa viber dialogflow php voiceassistant chatbot smartspeaker googleactions oop

convoworks-core's Introduction

Convoworks

Convoworks is a PHP framework for managing conversational services (Amazon Alexa skills, Google actions and chatbots over Dialogflow, Viber, FB Messenger ...) Here are few key features:

  • It defines conversation as a stream of reusable components which are manageable through admin API
  • It handles communication layer with connected platforms
  • It highly relies on PSRs and own interface definitions, so it can be used with any PHP application.

Overview

There are several logical parts inside Convoworks framework.

Core interfaces and implementations

This part defines what is service, and what kind of components it can use. It also defines persistence and platform communication layer.

Here are few parts to notice

  • \Convo\Core\Workflow namespace - defines workflow component types - elements, processors, filters
  • \Convo\Core\Intent namespace - defines Convoworks intent model
  • \Convo\Core\Params namespace - defines how the service runtime parameters are accessed or set
  • \Convo\Core\Publisher namespace - defines how we propagate definition to platforms
  • \Convo\Core\Factory namespace - defines how the service is loaded and how the components are created
  • \Convo\Core\ConvoServiceInstance class - the concrete service executor class

Admin REST

Admin rest allows access and management of the conversation workflow and publishing process. All handlers are placed in \Convo\Core\Admin namespace.

You can use the Convoworks Editor which is tailored to cover all Convoworks admin api functionalities.

There is also a Postman definition you can find in the docs folder which describes full API.

Adapters

Each supported platform has its own folder in the \Convo\Core\Adapters which contains several specific implementations required by the Convoworks. Firstly it defines http request handler for accepting platform requests. Then it defines how to create Convoworks request/response objects which are used in service workflow. It also implements how the service definition is propagated to target platforms.

Default component packages

Convoworks is shipped with a couple of packages which you'll use most of the time.

  • Core - This package is required in all services. Contains basic components that you will use most of the time. It also contains standard intent and entity definitions, common functions and service templates.
  • Dialogflow - Google assistant specific components
  • Gnlp - Google NLP based filtering - Can not be used with Alexa
  • Text - Plain text based filtering - Can not be used with Alexa
  • Visuals - Visual conversation elements

Integration

You can import and run Convoworks with in literally any PHP web application. If your app uses PSR compatible framework and Dependency Injection, than it is even easier.

Convoworks exposes its functionality through admin and public REST apis. Public API is used by conversational platforms (e.g. Amazon Alexa) and it does not need authentication. Each supported platform has its own handler. Admin API serves for managing the conversation flow, configurations and release handling. It requires authenticated user requests.

In order to mount Convoworks REST handlers, we have to bootstrap them somehow and we have to provide few implementations required by the system.

Admin users

Serves for accessing the logged user and enables saving some specific user data (e.g. platform access configuration), service ownership and sharing.

Convoworks is accessing user data through \Convo\Core\IAdminUserDataProvider interface which returns \Convo\Core\IAdminUser objects. You have to implement these two interfaces, because the user management is always system specific.

Service data storage

Service data layer defines loading/saving service data, managing versions and releases and stores service related, runtime parameters. It is defined with \Convo\Core\IServiceDataProvider, \Convo\Core\Params\IServiceParams and \Convo\Core\Params\IServiceParamsFactory interfaces.

We provided two service data implementations, one stores data on the filesystem - convoworks-data-filesystem and one is working with mysql - convoworks-mypdo.

Http factory

Convoworks requires a PSR compatible http client and uses it through the \Convo\Core\Util\IHttpFactory interface. You can use our convoworks-guzzle implementation.

Bootstrapping

Although you can manually create all required classes, we recommend using an PSR compatible DI container.

Here is the full ecosystem:

System utils

DI key Type Description
logger \Psr\Log\LoggerInterface Provides logger
httpFactory \Convo\Core\Util\IHttpFactory Provides http layer access to the system
currentTimeService \Convo\Core\Util\ICurrentTimeService Allows as to have mockable time provider
cache \Psr\SimpleCache\CacheInterface Provides access to cache infrastructure

Core functionality

DI key Type Description
adminUserDataProvider \Convo\Core\IAdminUserDataProvider Allows integration with your own admin users
convoServiceParamsFactory \Convo\Core\Params\IServiceParamsFactory For handling runtime parameters
convoServiceDataProvider \Convo\Core\IServiceDataProvider Service data persistance layer
serviceMediaManager \Convo\Core\Media\IServiceMediaManager Service media storage
convoServiceFactory \Convo\Core\Factory\ConvoServiceFactory Loads runnable service instance
platformRequestFactory \Convo\Core\Factory\PlatformRequestFactory Updates text based requests to intent based, through delegate platform
packageProviderFactory \Convo\Core\Factory\PackageProviderFactory Provides access to concrete package definitions
serviceReleaseManager \Convo\Core\Publish\ServiceReleaseManager Updates release and version information
platformPublisherFactory \Convo\Core\Publish\PlatformPublisherFactory Provides concrete platform publishers - \Convo\Core\Publish\IPlatformPublisher

Platform specifics

DI key Type Description
amazonAuthService \Convo\Core\Adapters\Alexa\AmazonAuthService Enables authentication for Amazon Alexa SMAPI
alexaRequestValidator \Convo\Core\Adapters\Alexa\Validators\AlexaRequestValidator Validates Amazon Alexa requests
amazonPublishingService \Convo\Core\Adapters\Alexa\AmazonPublishingService Our SMAPI implementation
dialogflowApiFactory \Convo\Core\Adapters\Dialogflow\DialogflowApiFactory Provides access to Dialogflow API
facebookMessengerApiFactory \Convo\Core\Adapters\Fbm\FacebookMessengerApiFactory Provides access to FB Messenger API
viberApi \Convo\Core\Adapters\Viber\ViberApi Our Viber API implementation

Admin API specifics

DI key Type Description
\Convo\Core\Admin\ServicesRestHandler \Convo\Core\Admin\ServicesRestHandler Service management
\Convo\Core\Admin\ServiceVersionsRestHandler \Convo\Core\Admin\ServiceVersionsRestHandler Service versions and releases management
\Convo\Core\Admin\ServicePlatformConfigRestHandler \Convo\Core\Admin\ServicePlatformConfigRestHandler Service platform configurations
\Convo\Core\Admin\UserPlatformConfigRestHandler \Convo\Core\Admin\UserPlatformConfigRestHandler Updates user configurations
\Convo\Core\Admin\UserPackgesRestHandler \Convo\Core\Admin\UserPackgesRestHandler Access to user packages
\Convo\Core\Admin\ServicePackagesRestHandler \Convo\Core\Admin\ServicePackagesRestHandler Service packages management
\Convo\Core\Admin\TemplatesRestHandler \Convo\Core\Admin\TemplatesRestHandler Access to available templates
\Convo\Core\Admin\TestServiceRestHandler \Convo\Core\Admin\TestServiceRestHandler Service simulator
\Convo\Core\Admin\ServiceImpExpRestHandler \Convo\Core\Admin\ServiceImpExpRestHandler Import/export service data
\Convo\Core\Admin\ComponentHelpRestHandler \Convo\Core\Admin\ComponentHelpRestHandler Loads component help if available
\Convo\Core\Admin\ConfigurationRestHandler \Convo\Core\Admin\ConfigurationRestHandler Loads configuration options
\Convo\Core\Admin\MediaRestHandler \Convo\Core\Admin\MediaRestHandler Service media management
propagationErrorReport \Convo\Core\Admin\PropagationErrorReport Error reporting utility

Public API specifics

DI key Type Description
\Convo\Core\Adapters\ConvoChat\ConvoChatRestHandler \Convo\Core\Adapters\ConvoChat\ConvoChatRestHandler Handles web chat requests
\Convo\Core\Adapters\Google\Dialogflow\DialogflowAgentRestHandler \Convo\Core\Adapters\Google\Dialogflow\DialogflowAgentRestHandler Handles Dialogflow requests
\Convo\Core\Adapters\Google\Gactions\ActionsRestHandler \Convo\Core\Adapters\Google\Gactions\ActionsRestHandler Handles direct Google Actions requests
\Convo\Core\Adapters\Fbm\FacebookMessengerRestHandler \Convo\Core\Adapters\Fbm\FacebookMessengerRestHandler Handles Messenger requests
\Convo\Core\Adapters\Viber\ViberRestHandler \Convo\Core\Adapters\Viber\ViberRestHandler Handles Viber requests
\Convo\Core\Adapters\Alexa\AlexaSkillRestHandler \Convo\Core\Adapters\Alexa\AlexaSkillRestHandler Handles Alexa requests
\Convo\Core\Adapters\Alexa\AmazonAuthRestHandler \Convo\Core\Adapters\Alexa\AmazonAuthRestHandler Oauth for enabling Amazon SMAPI access
\Convo\Core\Adapters\Alexa\CatalogRestHandler \Convo\Core\Adapters\Alexa\CatalogRestHandler Exposes entity catalogues to Alexa
\Convo\Core\Media\MediaRestHandler \Convo\Core\Media\MediaRestHandler Allows public access to service media
facebookAuthService \Convo\Core\Adapters\Fbm\FacebookAuthService Oauth for enabling Facebook API access

REST routing

Our handlers are always expecting convo/v1 as a base for all Convoworks requests, so you can use wildcard to route all such requests to the Convoworks request handlers. Please note that we have two separate REST APIs, public and admin so they are treated and mounted separately.

Instead of mapping each request handler we have, you can use our "grouped" handlers, just one per API. \Convo\Core\Adapters\PublicRestApi for public and \Convo\Core\Admin\AdminRestApi for admin API. Only difference is that in such a case you have to use a DI container.

Registering packages

Your application will also define which Convoworks custom packages will be available for use. Packages are registered by passing \Convo\Core\Factory\IPackageDescriptor objects to the \Convo\Core\Factory\PackageProviderFactory.

<?php

// example with function based factory
/** @var \Psr\Log\LoggerInterface $logger */
/** @var \Convo\Core\Factory\PackageProviderFactory $packageProviderFactory */
$packageProviderFactory->registerPackage( new FunctionPackageDescriptor('\Convo\Pckg\Trivia\TriviaPackageDefinition', function() use ( $logger, $packageProviderFactory) {
    return new \Convo\Pckg\Trivia\TriviaPackageDefinition(
        $logger, $packageProviderFactory
    );
}));

// example with class based factory - requires DI container!
/** @var \Psr\Container\ContainerInterface $container */
$packageProviderFactory->registerPackage( new ClassPackageDescriptor('\Convo\Pckg\Trivia\TriviaPackageDefinition', $container));

Admin API Authentication

Once you have that implemented, you have to make logged user available for REST handlers. Somewhere in the app bootstrap process, set the request attribute Convo\Core\IAdminUser to your user (which implements \Convo\Core\IAdminUser).

<?php

$user       =   $this->_adminUserDataProvider->findUser( 'myusernameiremail');
$request    =   $request->withAttribute( \Convo\Core\IAdminUser::class, $user);

Roadmap

  • APL support - Alexa Presentation Language allows creation of much more delightful user interfaces for Alexa devices.
  • Prefix our intent model on target platforms - It will enable users to manually create additional intents and entities directly on platform and not to be overwritten when model is propagated
  • Propagate platform system events - Ability to reference some platform intent or entity in a manner that it will be automatically turned on when we propagate Convoworks intent model
  • Component migration interface to packages - Ability to migrate component definitions to the new version. Right now it is on the core level, but should be on the package.
  • Package files - ability to deploy files inside component packages to be used in services (mp3 audio prompts, images ...)
  • Increase unit test coverage -

Convoworks Prototype

You can check our example integration called Convoworks Prototype. You can download it and find more information here


For more information, please check out convoworks.com

convoworks-core's People

Contributors

mmarcec007 avatar pgal66 avatar tefached95 avatar tolecar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

convoworks-core's Issues

Serialize HTML Help response to JSON response

Currently in src/Convo/Core/Admin/ComponentHelpRestHandler::_provideHtmlPackageComponentHelpFile the response is returned as Content-Type: 'html/text'.
This needs to be changed to Content-Type: 'application/json'.

Also test this on the GIU in convoworks-proto and possibly apply a change where this JSON response will be resolved as actual HTML.

Move preview building to blocks

We should deprecate the current preview builder class and have each block be responsible for generating its own preview.

This allows for much more flexibility in generating preview sections, not the least of which being that we'd no longer have to assume a simple 3-part structure of bot says, user says, bot responds.

URL Supplier Mechanism

On the server side create an interface and implementation of the interface on Convoworks proto. Add routes to admin from which the URLs will be generated.

Media request keeps triggering when there is no Media Block

After taking a closer look on the log on our production environment convo-2021-01-05.log it seems that the problem occurs in mtg-database service.
Log snippet:

[01:36:40:57746] uLqdP1b public.CRITICAL: [Convo\Core\Util\RequestResponseDumpMiddleware:process(95)] Convo\Core\ComponentNotFoundException: Block with role [media_player] not found in /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/ConvoServiceInstance.php:604
Stack trace:
#0 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/ConvoServiceInstance.php(324): Convo\Core\ConvoServiceInstance->getBlockByRole('media_player')
#1 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Adapters/Alexa/AlexaSkillRestHandler.php(113): Convo\Core\ConvoServiceInstance->run(Object(Convo\Core\Adapters\Alexa\AmazonCommandRequest), Object(Convo\Core\Adapters\Alexa\AmazonCommandResponse))
#2 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Adapters/Alexa/AlexaSkillRestHandler.php(87): Convo\Core\Adapters\Alexa\AlexaSkillRestHandler->_handleAlexaSkillPathServiceIdPost(Object(GuzzleHttp\Psr7\ServerRequest), 'a', 'mtg-database', Array)
#3 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Adapters/PublicRestApi.php(88): Convo\Core\Adapters\Alexa\AlexaSkillRestHandler->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#4 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Util/RestApp.php(70): Convo\Core\Adapters\PublicRestApi->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#5 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Util/RequestResponseDumpMiddleware.php(45): Convo\Core\Util\RestApp->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#6 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Util/RestApp.php(65): Convo\Core\Util\RequestResponseDumpMiddleware->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Convo\Core\Util\RestApp))
#7 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Util/JsonHeaderMiddleware.php(14): Convo\Core\Util\RestApp->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#8 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Util/RestApp.php(65): Convo\Core\Util\JsonHeaderMiddleware->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Convo\Core\Util\RestApp))
#9 /var/www/ConvoWorks/prod/library/vendor/middlewares/trailing-slash/src/TrailingSlash.php(57): Convo\Core\Util\RestApp->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#10 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Util/RestApp.php(65): Middlewares\TrailingSlash->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Convo\Core\Util\RestApp))
#11 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Rest/ConvoExceptionHandler.php(32): Convo\Core\Util\RestApp->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#12 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Util/RestApp.php(65): Convo\Core\Rest\ConvoExceptionHandler->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Convo\Core\Util\RestApp))
#13 /var/www/ConvoWorks/prod/library/Convo/Proto/LoadPackagesMiddleware.php(104): Convo\Core\Util\RestApp->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#14 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Util/RestApp.php(65): Convo\Proto\LoadPackagesMiddleware->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Convo\Core\Util\RestApp))
#15 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Util/BodyParserMiddleware.php(33): Convo\Core\Util\RestApp->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#16 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Util/RestApp.php(65): Convo\Core\Util\BodyParserMiddleware->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Convo\Core\Util\RestApp))
#17 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Util/LogRequestMiddleware.php(49): Convo\Core\Util\RestApp->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#18 /var/www/ConvoWorks/prod/library/vendor/zef-dev/convoworks-core/src/Convo/Core/Util/RestApp.php(65): Convo\Core\Util\LogRequestMiddleware->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Convo\Core\Util\RestApp))
#19 /var/www/ConvoWorks/prod/www/rest_public/index.php(77): Convo\Core\Util\RestApp->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#20 {main}

After observation of the workflow in 'mtg-database' service it seems that the following snippet triggered the media reqeust in AmazonCommandRequest which is wrong:

{ "class": "\\Convo\\Pckg\\Core\\Processors\\SimpleProcessor", "namespace": "convo-core", "properties": { "ok": [ { "class": "\\Convo\\Pckg\\Core\\Elements\\GoToElement", "namespace": "convo-core", "properties": { "value": "Main_Menu", "next": false, "_component_id": "lfrlfq7p-vnlg-kenc-wxih-tv3ndtnfpnla" } } ], "request_filters": [ { "class": "\\Convo\\Pckg\\Core\\Filters\\IntentRequestFilter", "namespace": "convo-core", "properties": { "readers": [ { "class": "\\Convo\\Pckg\\Core\\Filters\\ConvoIntentReader", "namespace": "convo-core", "properties": { "intent": "convo-core.NavigateHomeIntent", "values": [], "rename": [], "_component_id": "r3smn8mn-4irp-ra2v-g2qy-xzoesnivf5l6" } }, { "class": "\\Convo\\Pckg\\Core\\Filters\\ConvoIntentReader", "namespace": "convo-core", "properties": { "intent": "BackToSearchIntent", "values": [], "rename": [], "_component_id": "69skkrzg-2lvf-ww22-eotj-0b1sazdwtuuu" } }, { "class": "\\Convo\\Pckg\\Core\\Filters\\ConvoIntentReader", "namespace": "convo-core", "properties": { "intent": "convo-core.PreviousIntent", "values": [], "rename": [], "_component_id": "xoesj9vh-g9lc-fi7f-5tei-dz1yfbsnvodr" } } ], "_component_id": "vtjlbiig-ze7m-jfmq-grff-tzhlcqck8hlv" } } ], "_component_id": "5txhwhkw-yula-z3yw-qqg4-73cktzudefll" } }

Final conclusion is that the method isMediaRequest in AmazonCommandRequest delivers wrong result when some of the following intents occur:

  • AMAZON.RepeatIntent
  • AMAZON.CancelIntent
  • AMAZON.NextIntent
  • AMAZON.PreviousIntent
  • AMAZON.StopIntent
  • AMAZON.PauseIntent
  • AMAZON.ResumeIntent
  • AMAZON.StartOverIntent
  • AMAZON.LoopOnIntent
  • AMAZON.LoopOffIntent
  • AMAZON.ShuffleOnIntent
  • AMAZON.ShuffleOffIntent

For this particular case it was AMAZON.PreviousIntent in 'mtg-database' service.

Expression parser is not able to handle associative arrays inside expression

While evaluating strings, EvalContext:_extractExpressions() has to parse out all expressions which are defined with ${}. As the PHP associative array syntax uses curly brackets too, current parsing mechanism is not able to handle it right,

Example:

indexed array is OK ${count(['a', 'b'])}
associative array will fail ${count({'a'=>'option', 'b'=>'other option'})}

Requirements:

  • add unit test which will test associative array parsing (and will fail currently)
  • improve parsing to support use of associative arrays

Side note:

It seems like this functionality might be migrated to the https://github.com/zef-dev/zef-expression-language library

Self signed SSL Certificate on Amazon Propagation Problem

When trying to propagate Alexa Skill with selected option 'I will upload a self-signed certificate in X 509 format' of Endpoint SSL Certificate Type, the following error occurs:
Amazon propagation error: Payload for SSL certificate is invalid.. Error details: String instance with value "SELF_SIGNED" at property path "$.manifest.apis.custom.endpoint.sslCertificateType" is expected to be present when string instance with value "https://mark-test.ngrok.io/convosite/wp-json/convo/v1/public/service-run/amazon/a/bcm" at property path "$.manifest.apis.custom.endpoint.uri" is present.

Instead of getting the contents by URL, just store the file content in config value and propagate the content directly.

Dialogflow empty response

The dialogflow empty response implementation in Convo/Core/Adapters/Google/Dialogflow/DialogflowCommandResponse.php is wrong.
It causes an error on Google Assistant Tester and devices.

TODO:

  • let's see how can we make an Dialogflow empty response and implement it

Refactor preview so that one component can provide multiple speech sources

Any component that is considered a speech source currently provides only one speech part component. This worked under the presumption mainly that any single workflow component will only ever provide one particular speech source. For example, a single intent reader provides only the utterances from the intent it reads.

However, custom elements, such as blocks and processors, may define several internal intent readers which are all grouped under the same element. Instead of having several intent reader elements which can each provide one speech part, this is a single element that should be able to provide multiple speech parts.

Display current build status for external platforms

After the propagation was issued, it would be useful to see the status of the propagated platform build.

Things we need on the core side:

  1. New endpoint
  2. new getStatus() method in Convo\Core\Publish\IPlatformPublisher which other classes will implement
  3. status constants
  4. Check status before propagation was issued

Card Visual Block

Card Block
Define a new block in convoworks with name Card Block which will make it easier to work with cards on Amazon Alexa, Google Assistant, Facebook Messenger and Viber.

Block Properties itself:

  • item -> preferable this is the selected object of an list item ow which we want to perform certain actions like order, even more details, call and so on (just a object no more no lesss)
  • item name -> under which name to store data item name
  • back button visible -> choose between hidden or visible back button. (works only on Alexa)
  • data item title -> Title of the item which will be displayed on the card
  • data item subtitle -> subtitle of the item which will be displayed on the card
  • data item description -> primary description of the item which will be displayed on the card
  • data item image url -> link to the image of an item in the card (preferable an https link should be used)
  • data item image text -> accessibility text of the image of an item in the card (Required if you want to display the image.)

Block Containers:

  • Read Phase -> display the card itself (this is added automatically) and support is added for other convoworks responses such as text response, set parameter, if and so on. Also if the text is added the default text response will be overridden.
  • On No Screen Supported -> will be executed instead if the device has no support for a screen
  • Card Actions -> will be executed when an action of the issued card was selected (more on those card actions later)
  • Additional Processors -> will be executed of another things of other processors are matched

Card Actions:

  • this should be a specialized processor
  • its filter checks for a card specific card event or utterance or anything of this nature
  • this should be defined in an separate interface and checked as the specified interface to avoid confusion between CardActionProcessors and Other Convoworks Processors.

Additional specifications:

  • Define new request interfaces IConvoCardRequest which will make it easier to get values from those requests from each platform and implement them in each PlatformRequest
  • Define new response interfaces IConvoCardResponse which will make it easier to define the final response for each platform and implement them in each PlatformResponse

Please also refer to the Dummy representation of the Card Block.

card_block_image

Dialogflow API missing extension "ext-bcmath"

In some cases the Convoworks conversation tester fails on Dialogflow with some words like 'ceca', 'e' and so on. It looks like that the ext-bcmath is missing in composer.json file. Solution would be to just add the extension in composer.json and test it on stage since the same behavior appears on stage but not in my local machine.

Invalid Unicode char when propagating interaction model to Amazon

Here is the attached log line which gives more details on this issue:
[09:59:25:96666] 1eUBLUD admin.CRITICAL: [Convo\Core\Admin\ServicePlatformConfigRestHandler:_performServicePlatformPropagatePathServiceIdPathPlatformIdPost(188)] {"message":"Interaction model is not valid.","violations":[{"message":"InvalidCharInSamples: "latest" in the sample utterance "PlayNewestIntent: Play latest first" is invalid. Sample utterances can consist of only unicode characters, spaces, periods for abbreviations, underscores, possessive apostrophes, and hyphens."}]}
[09:59:25:96674] 1eUBLUD admin.INFO: [Convo\Core\Admin\PropagationErrorReport:craftErrorReport(29)] amazon error: {"message":"Interaction model is not valid.","violations":[{"message":"InvalidCharInSamples: "latest" in the sample utterance "PlayNewestIntent: Play latest first" is invalid. Sample utterances can consist of only unicode characters, spaces, periods for abbreviations, underscores, possessive apostrophes, and hyphens."}]}
[09:59:25:97316] 1eUBLUD admin.INFO: [Convo\Core\Util\LogRequestMiddleware:process(54)] Returning HTTP [400] in 1751.4960765839 ms
Waiting for data... (interrupt to abort)

List item response platform rendering issue

While I was testing the backwards combability of our Visual Elements on Alexa, the renderer on Alexa Developer Console Test View throwed some unusual error.

More on that error is in the following screenshot:
Alexa List Renderrer Error

After taking a closer look it seems that list items that contain special character like '&', produce unexpected skill errors.

Sample data that was used against:

{
  "meals": [
    {
      "strMeal": "Chick-Fil-A Sandwich",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/sbx7n71587673021.jpg",
      "idMeal": "53016"
    },
    {
      "strMeal": "Chicken Couscous",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/qxytrx1511304021.jpg",
      "idMeal": "52850"
    },
    {
      "strMeal": "Chicken Fajita Mac and Cheese",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/qrqywr1503066605.jpg",
      "idMeal": "52818"
    },
    {
      "strMeal": "Chicken Ham and Leek Pie",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/xrrtss1511555269.jpg",
      "idMeal": "52875"
    },
    {
      "strMeal": "Chicken Quinoa Greek Salad",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/k29viq1585565980.jpg",
      "idMeal": "53011"
    },
    {
      "strMeal": "General Tso's Chicken",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/1529444113.jpg",
      "idMeal": "52951"
    },
    {
      "strMeal": "Honey Balsamic Chicken with Crispy Broccoli & Potatoes",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/kvbotn1581012881.jpg",
      "idMeal": "52993"
    },
    {
      "strMeal": "Katsu Chicken curry",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/vwrpps1503068729.jpg",
      "idMeal": "52820"
    },
    {
      "strMeal": "Rappie Pie",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/ruwpww1511817242.jpg",
      "idMeal": "52933"
    }
  ]
}

The following record with strMeal Honey Balsamic Chicken with Crispy Broccoli & Potatoes produced this unexpected error.

The solution is to replace such character with their appropriate substitutes on all platforms.

List Visual Block

List Block
Define a new block in convoworks with name List Block which will make it easier to work with lists on Amazon Alexa, Google Assistant, Facebook Messenger and Viber.

Block Properties itself:

  • list title -> displays the title of the list
  • list template -> offers selection between carousel view and list view if possible
  • items -> this is the object which contains the contents of the list items
  • offset ->
  • limit ->user defined limit which can be overridden by platform upper limit
  • list item name -> under which name to store list item name
  • list item title -> title of the item which is in the list
  • list item description -> description of the item which is in the list
  • list item image url -> link to the image of an item in the list
  • list item image text -> accessibility text of the image of an item in the list (Required if you want to display the image!)

Block Containers:

  • Read Phase -> display the list itself and support is added for other convoworks responses such as text response, set parameter, if and so on
  • On No Screen Supported -> will be executed instead if the device has no support for a screen
  • On List Item Selected -> will be executed when an item of the list was selected
  • Additional Processors -> will be executed of another things of other processors are matched

Additional specifications:

  • Define new request interfaces IConvoListRequest which will make it easier to get values from those requests from each platform and implement them in each PlatformRequest
  • Define new response interfaces IConvoListResponse which will make it easier to define the final response for each platform and implement them in each PlatformResponse

Please also refer to the Dummy representation of the List Block.

Dummy representation of the List Block:
list_block_image

Alexa Skill gets deleted when configuration is set to manual

When a service is deleted in convoworks, Alexa skill is also deleted when the mode is set to manual. This shouldn't be the case. Rather checks if the configuration is set to auto. Also check other platforms for this behavior.

Reproduce:

  • Create Amazon config in manual mode
  • Try to delete service

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.