jovotech / jovo-framework

🔈 The React for Voice and Chat: Build Apps for Alexa, Messenger, Instagram, the Web, and more
https://www.jovo.tech
Apache License 2.0
1.67k stars 310 forks source link

Invalid agent.json on deploy #559

Closed santhosh77h closed 5 years ago

santhosh77h commented 5 years ago

I'm submitting a...

Expected Behavior

jovo build -p googleAction --deploy would create .zip file under googleActions but the problem is agent.json which is available in side the .zip where supportedLanguages key should have a value ja for ja-JP

Sadly we get this error on multi language support actions

I have tested this on ja-JP and en-US

Current Behavior

But currently we can see that it would create it as ja-JP because of this Dialog Flow would throw an error that ja-JP is not a supported language.

Inside Dialog Flow we would get error as

Platform does not support ja-JP.

Your Environment

aswetlow commented 5 years ago

Hey @santhosh77h!

I was able to reproduce it. You can change your model filename ja-JP.json to ja.json.

But you have to change the nlu property if you want to use it with Alexa.

 alexaSkill: {
       nlu: {
          name: 'alexa',
          lang: {
             ja: [
                'ja-JP',
              ] 
         }
       }
    },

This will map languages to locales. I mostly use it with en.json to map it to en-US, en-CA, en-GB etc

santhosh77h commented 5 years ago

@aswetlow thanks for the quick response but deployment was not working got this error

✖ Updating Alexa Skill project for ASK profile profile-dev -> askApiUpdateSkill:Skill manifest is not valid. Object instance at property path "$.manifest.publishingInformation.locales" has no property defined

skill.json after build it looks like this

{
    "manifest": {
        "publishingInformation": {
            "locales": {},
            "isAvailableWorldwide": true,
            "testingInstructions": "Sample Testing Instructions.",
            "category": "EDUCATION_AND_REFERENCE",
            "distributionCountries": []
        },
        "apis": {
            "custom": {
                "endpoint": {
                    "sslCertificateType": "Wildcard",
                    "uri": "https://webhook.jovo.cloud/id_removed"
                }
            }
        },
        "manifestVersion": "1.0",
        "privacyAndCompliance": {
            "allowsPurchases": false,
            "locales": {},
            "isExportCompliant": true,
            "containsAds": false,
            "isChildDirected": false,
            "usesPersonalInfo": false
        }
    }
}
aswetlow commented 5 years ago

Hm, do you have the latest version of the cli? jovo --v

This is my working setup:

project.js

// ------------------------------------------------------------------
// JOVO PROJECT CONFIGURATION
// ------------------------------------------------------------------

module.exports = {
    alexaSkill: {
       nlu: {
          name: 'alexa',
          lang: {
             ja: [
                'ja-JP',
              ],
              'de-DE': [
                 'de-DE'
              ]
         }
       },
    },
    googleAction: {
       nlu: 'dialogflow',
    },
    endpoint: '${JOVO_WEBHOOK_URL}',
};

/platforms/alexaSkill/skill.json after jovo build

{
    "manifest": {
        "publishingInformation": {
            "locales": {
                "de-DE": {
                    "summary": "Sample Short Description",
                    "examplePhrases": [
                        "Alexa open hello world"
                    ],
                    "keywords": [
                        "hello",
                        "world"
                    ],
                    "name": "issue559",
                    "description": "Sample Full Description",
                    "smallIconUri": "https://via.placeholder.com/108/09f/09f.png",
                    "largeIconUri": "https://via.placeholder.com/512/09f/09f.png"
                },
                "en-US": {
                    "summary": "Sample Short Description",
                    "examplePhrases": [
                        "Alexa open hello world"
                    ],
                    "keywords": [
                        "hello",
                        "world"
                    ],
                    "name": "issue559",
                    "description": "Sample Full Description",
                    "smallIconUri": "https://via.placeholder.com/108/09f/09f.png",
                    "largeIconUri": "https://via.placeholder.com/512/09f/09f.png"
                },
                "ja-JP": {
                    "summary": "Sample Short Description",
                    "examplePhrases": [
                        "Alexa open hello world"
                    ],
                    "keywords": [
                        "hello",
                        "world"
                    ],
                    "name": "issue559",
                    "description": "Sample Full Description",
                    "smallIconUri": "https://via.placeholder.com/108/09f/09f.png",
                    "largeIconUri": "https://via.placeholder.com/512/09f/09f.png"
                }
            },
            "isAvailableWorldwide": true,
            "testingInstructions": "Sample Testing Instructions.",
            "category": "EDUCATION_AND_REFERENCE",
            "distributionCountries": []
        },
        "apis": {
            "custom": {
                "endpoint": {
                    "sslCertificateType": "Wildcard",
                    "uri": "https://webhook.jovo.cloud/"
                }
            }
        },
        "manifestVersion": "1.0",
        "privacyAndCompliance": {
            "allowsPurchases": false,
            "locales": {
                "de-DE": {
                    "privacyPolicyUrl": "http://example.com/policy",
                    "termsOfUseUrl": ""
                },
                "en-US": {
                    "privacyPolicyUrl": "http://example.com/policy",
                    "termsOfUseUrl": ""
                },
                "ja-JP": {
                    "privacyPolicyUrl": "http://example.com/policy",
                    "termsOfUseUrl": ""
                }
            },
            "isExportCompliant": true,
            "containsAds": false,
            "isChildDirected": false,
            "usesPersonalInfo": false
        }
    }
}

Could you delete /platforms/alexaSkill and rerun jovo build ?

santhosh77h commented 5 years ago

Previous JOVO version is 2.2.8 after updating to 2.2.12 JOVO cli was able to create the skill.json correctly. Thank you for the help