1
1
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:
louistiti 2022-02-23 21:33:47 +08:00
parent 4107932d00
commit 975b8ebcf0
No known key found for this signature in database
GPG Key ID: 0A1C3B043E70C77D
29 changed files with 126 additions and 11 deletions

6
core/data/en/colors.json Normal file
View File

@ -0,0 +1,6 @@
{
"options": {
"red": ["red"],
"blue": ["blue"]
}
}

6
core/data/fr/colors.json Normal file
View File

@ -0,0 +1,6 @@
{
"options": {
"rouge": ["rouge"],
"bleu": ["bleu"]
}
}

View File

@ -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",

View File

View File

View 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": { }
}

View File

@ -0,0 +1 @@
{}

View 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"
}
}

View 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'))

View File

@ -0,0 +1,6 @@
{
"configurations": {
"options": {},
"credentials": {}
}
}

View File

View File

View File

@ -1,5 +1,6 @@
{
"name": "Good Bye",
"type": "logic",
"bridge": "python",
"version": "1.0.0",
"description": "Leon says good bye.",

View File

@ -1,5 +1,6 @@
{
"name": "Greeting",
"type": "logic",
"bridge": "python",
"version": "1.0.0",
"description": "Leon greets you.",

View File

@ -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.",

View File

@ -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"],

View File

@ -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"],

View File

@ -1,5 +1,6 @@
{
"name": "Partner Assistant",
"type": "logic",
"bridge": "python",
"version": "1.0.0",
"description": "Leon tells about other virtual assistants.",

View File

@ -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(' ', '_')))

View File

@ -1,5 +1,6 @@
{
"name": "Random Number",
"type": "logic",
"bridge": "python",
"version": "1.0.0",
"description": "Leon gives a random number.",

View File

@ -1,5 +1,6 @@
{
"name": "Welcome",
"type": "logic",
"bridge": "python",
"version": "1.0.0",
"description": "Leon welcomes you.",

View File

@ -1,5 +1,6 @@
{
"name": "Who Am I",
"type": "logic",
"bridge": "python",
"version": "1.0.0",
"description": "Leon introduces himself.",

View File

@ -1,5 +1,6 @@
{
"name": "GitHub Trends",
"type": "logic",
"bridge": "python",
"version": "1.0.0",
"description": "Get what is trending on GitHub.",

View File

@ -1,5 +1,6 @@
{
"name": "Product Hunt Trends",
"type": "logic",
"bridge": "python",
"version": "1.0.0",
"description": "Get what is trending on Product Hunt.",

View File

@ -1,5 +1,6 @@
{
"name": "Todo List",
"type": "logic",
"bridge": "python",
"version": "1.0.0",
"description": "Manage your lists and the items they contain.",

View File

@ -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).",

View File

@ -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.",

View File

@ -1,5 +1,6 @@
{
"name": "Speed Test",
"type": "logic",
"bridge": "python",
"version": "1.0.0",
"description": "Gives info about your network speed.",

View File

@ -1,5 +1,6 @@
{
"name": "YouTube Downloader",
"type": "logic",
"bridge": "python",
"version": "1.0.0",
"description": "Download new videos from a YouTube playlist.",