title | excerpt |
---|---|
Model Schema |
Learn more about all the elements that are part of the Jovo Model. |
Learn more about all the elements that are part of the Jovo Model.
Each locale is represented by its own model. For example, the en.json
in the Jovo v4 template looks like this:
{
"version": "4.0",
"invocation": "my test app",
"intents": {
"YesIntent": {
"phrases": [
"yes",
"yes please",
"sure"
]
},
"NoIntent": {
"phrases": [
"no",
"no thanks"
]
}
}
}
Learn more about all properties in the sections below:
version
: The Jovo Model version (introduced with Jovov4
)invocation
: How the app is launched on voice assistant platformsintents
: Groups ofphrases
andentities
entityTypes
: Types of entities that can be used across intents- platform-specific elements: Elements that are only added for some platforms, e.g.
alexa
{
"version": "4.0",
// ...
}
The invocation
is used by some voice assistant platforms as the app name to access the app.
{
"invocation": "my test app",
// ...
}
It is possible to add platform-specific invocations like this:
{
"invocation": {
"alexa": "my test skill",
"googleAssistant": "my test action"
}
// ...
}
Currently, this element is supported by Alexa Skills and Google Assistant Conversational Actions.
Intents can be added to the JSON as objects that include:
This is how a MyNameIsIntent
could look like:
{
"intents": {
"MyNameIsIntent": {
"phrases": [
"{name}",
"my name is {name}",
"i am {name}",
"you can call me {name}"
],
"entities": {
"name": {
"type": {
"alexa": "AMAZON.US_FIRST_NAME",
"dialogflow": "@sys.given-name"
}
}
}
}
}
// ...
}
This is an array of example phrases
that will be used to train the language model on the respective NLU platforms.
Some providers use different names for these phrases, for example utterances, samples, or "user says."
"MyNameIsIntent": {
"phrases": [
"{name}",
"my name is {name}",
"i am {name}",
"you can call me {name}"
],
// ...
}
Often, phrases contain variable input such as slots or entities, as some NLU services call them. In the Jovo Model, they are called entities
.
Entities consist of a name
(how it's referenced in the phrases) and a type
(learn more in the entityTypes
section). For example an intent with phrases like I live in {city}
would come with an entity like this:
"MyCityIntent": {
"entities": {
"city": {
"type": "myCityEntityType"
}
},
// ...
}
You can also choose to provide different entity types for each NLU service:
"MyNameIsIntent": {
"entities": {
"name": {
"type": {
"alexa": "AMAZON.US_FIRST_NAME",
"dialogflow": "@sys.given-name"
}
}
},
// ...
}
You can either reference entity types defined in the entityTypes
object, or reference built-in entity types provided by the respective NLU platforms (like AMAZON.US_FIRST_NAME
for Alexa).
The entityTypes
object lists all the entity types that are referenced as entities
inside intents
.
Each input type contains:
- a name as object key
values
{
"entityTypes": {
"myCityEntityType": {
"values": [
"Berlin",
"New York"
]
}
},
// ...
}
You can define the values for an entity type by either adding as strings or objects. For example this is how the myCityEntityType
looks like with two values:
"myCityEntityType": {
"values": [
"Berlin",
"New York"
]
}
Some entity values could be expressed in the same way. For this, you can add synonyms
by turning the value into an object:
"myCityEntityType": {
"values": [
"Berlin",
{
"value": "New York",
"synonyms": [
"New York City",
"NYC"
]
}
]
}
Some intents or entity types may be needed for just some platforms. You can define them as additional elements as shown for Alexa in the example below:
{
// ...
"alexa": {
"interactionModel": {
"languageModel": {
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
}
]
}
}
}
}
The format of the elements inside the alexa
object from above is the original structure of the Alexa Interaction Model. For example, phrases
(Jovo Model naming) are called samples
here.