mirror of
https://github.com/leon-ai/leon.git
synced 2024-11-23 20:12:08 +03:00
feat: context and slot filling preparation (wip)
This commit is contained in:
parent
4107932d00
commit
975b8ebcf0
6
core/data/en/colors.json
Normal file
6
core/data/en/colors.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"options": {
|
||||
"red": ["red"],
|
||||
"blue": ["blue"]
|
||||
}
|
||||
}
|
6
core/data/fr/colors.json
Normal file
6
core/data/fr/colors.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"options": {
|
||||
"rouge": ["rouge"],
|
||||
"bleu": ["bleu"]
|
||||
}
|
||||
}
|
@ -1,5 +1,20 @@
|
||||
{
|
||||
"endpoints": [
|
||||
{
|
||||
"method": "GET",
|
||||
"route": "/api/action/leon/color/favorite_color",
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"method": "GET",
|
||||
"route": "/api/action/leon/color/color_meaning",
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"method": "GET",
|
||||
"route": "/api/action/leon/color/why",
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"method": "GET",
|
||||
"route": "/api/action/leon/good_bye/run",
|
||||
|
0
skills/leon/color/README.md
Normal file
0
skills/leon/color/README.md
Normal file
0
skills/leon/color/memory/.gitkeep
Normal file
0
skills/leon/color/memory/.gitkeep
Normal file
44
skills/leon/color/nlu/en.json
Normal file
44
skills/leon/color/nlu/en.json
Normal file
@ -0,0 +1,44 @@
|
||||
{
|
||||
"variables": {
|
||||
"blue_leon": "#1C75DB",
|
||||
"pink_leon": "#ED297A"
|
||||
},
|
||||
"actions": {
|
||||
"favorite_color": {
|
||||
"utterance_samples": [
|
||||
"What is your favorite color?",
|
||||
"What color is the best for you?",
|
||||
"Is there any color you love?",
|
||||
"I love the @color color, how about you?"
|
||||
],
|
||||
"answers": [
|
||||
"Where I live it is all black, but I believe I tend to have a preference for %blue_leon% and %pink_leon%. Do not ask why...",
|
||||
"Sometimes %blue_leon%, sometimes %pink_leon%",
|
||||
"I think %color% is a good color, but I prefer blue and pink. Don't ask me why..."
|
||||
]
|
||||
},
|
||||
"color_meaning": {
|
||||
"utterance_samples": [
|
||||
"Tell me something about colors",
|
||||
"Tell me something about the @color color",
|
||||
"I want to know about the @color color",
|
||||
"How about the @color color?"
|
||||
],
|
||||
"answers": [
|
||||
|
||||
]
|
||||
},
|
||||
"why": {
|
||||
"utterance_samples": [
|
||||
"Why do you like this color?",
|
||||
"Why this color?",
|
||||
"Why not another one?",
|
||||
"Why?"
|
||||
]
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
"color": "@/colors.json"
|
||||
},
|
||||
"answers": { }
|
||||
}
|
1
skills/leon/color/nlu/fr.json
Normal file
1
skills/leon/color/nlu/fr.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
12
skills/leon/color/skill.json
Normal file
12
skills/leon/color/skill.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "Color",
|
||||
"type": "dialog",
|
||||
"bridge": null,
|
||||
"version": "1.0.0",
|
||||
"description": "Leon tells about colors.",
|
||||
"author": {
|
||||
"name": "Louis Grenard",
|
||||
"email": "louis.grenard@gmail.com",
|
||||
"url": "https://github.com/louistiti"
|
||||
}
|
||||
}
|
9
skills/leon/color/src/actions/run.py
Normal file
9
skills/leon/color/src/actions/run.py
Normal file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding:utf-8 -*-
|
||||
|
||||
import utils
|
||||
|
||||
def run(string, entities):
|
||||
"""Leon says good bye"""
|
||||
|
||||
return utils.output('end', 'good_bye', utils.translate('good_bye'))
|
6
skills/leon/color/src/config.sample.json
Normal file
6
skills/leon/color/src/config.sample.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"configurations": {
|
||||
"options": {},
|
||||
"credentials": {}
|
||||
}
|
||||
}
|
0
skills/leon/color/src/lib/.gitkeep
Normal file
0
skills/leon/color/src/lib/.gitkeep
Normal file
0
skills/leon/color/test/.gitkeep
Normal file
0
skills/leon/color/test/.gitkeep
Normal file
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Good Bye",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Leon says good bye.",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Greeting",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Leon greets you.",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Meaning of Life",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Leon tells what is the meaning of life.",
|
||||
|
@ -2,15 +2,16 @@
|
||||
"actions": {
|
||||
"run": {
|
||||
"utterance_samples": [
|
||||
"Do you have something to say about @partnerAssistant?",
|
||||
"Tell me about the personal assistant @partnerAssistant",
|
||||
"I want to know more about @partnerAssistant",
|
||||
"Tell me something related to @partnerAssistant"
|
||||
"Do you have something to say about @partner_assistant?",
|
||||
"Tell me about the personal assistant @partner_assistant",
|
||||
"I want to know more about @partner_assistant",
|
||||
"Tell me something related to @partner_assistant",
|
||||
"Do you know @partner_assistant?"
|
||||
]
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
"partnerAssistant": {
|
||||
"partner_assistant": {
|
||||
"options": {
|
||||
"Alexa": ["alexa"],
|
||||
"Cortana": ["cortana"],
|
||||
|
@ -2,15 +2,16 @@
|
||||
"actions": {
|
||||
"run": {
|
||||
"utterance_samples": [
|
||||
"Connais-tu quelque chose sur @partnerAssistant ?",
|
||||
"Dis-moi quelque chose sur l'assistant personnel @partnerAssistant",
|
||||
"Dis-moi quelque chose à propos de @partnerAssistant",
|
||||
"Je veux en savoir plus au sujet de @partnerAssistant"
|
||||
"Connais-tu quelque chose sur @partner_assistant ?",
|
||||
"Dis-moi quelque chose sur l'assistant personnel @partner_assistant",
|
||||
"Dis-moi quelque chose à propos de @partner_assistant",
|
||||
"Je veux en savoir plus au sujet de @partner_assistant",
|
||||
"Connais-tu @partner_assistant ?"
|
||||
]
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
"partnerAssistant": {
|
||||
"partner_assistant": {
|
||||
"options": {
|
||||
"Alexa": ["alexa"],
|
||||
"Cortana": ["cortana"],
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Partner Assistant",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Leon tells about other virtual assistants.",
|
||||
|
@ -10,7 +10,7 @@ def run(string, entities):
|
||||
|
||||
# Find entities
|
||||
for item in entities:
|
||||
if item['entity'] == 'partnerAssistant':
|
||||
if item['entity'] == 'partner_assistant':
|
||||
partner = item['option'].lower()
|
||||
return utils.output('end', 'success', utils.translate(partner.replace(' ', '_')))
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Random Number",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Leon gives a random number.",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Welcome",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Leon welcomes you.",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Who Am I",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Leon introduces himself.",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "GitHub Trends",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Get what is trending on GitHub.",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Product Hunt Trends",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Get what is trending on Product Hunt.",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Todo List",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Manage your lists and the items they contain.",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Have I Been Pwned",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Verify if one or several email addresses have been pwned (thanks to haveibeenpwned.com).",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Is It Down",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Ping domain names and gives the online state.",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Speed Test",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Gives info about your network speed.",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "YouTube Downloader",
|
||||
"type": "logic",
|
||||
"bridge": "python",
|
||||
"version": "1.0.0",
|
||||
"description": "Download new videos from a YouTube playlist.",
|
||||
|
Loading…
Reference in New Issue
Block a user