Code Monkey home page Code Monkey logo

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

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

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.

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

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.

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

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.

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

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.

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

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.

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)

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.

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.

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.

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.