1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-11-23 20:12:08 +03:00

refactor(skill/random_number): from module to skill

This commit is contained in:
louistiti 2022-02-21 23:06:08 +08:00
parent dc4b6ff296
commit 41c4436924
No known key found for this signature in database
GPG Key ID: 7ECA3DD523793FE6
10 changed files with 60 additions and 0 deletions

View File

@ -25,6 +25,11 @@
"route": "/api/action/leon/partner_assistant/run",
"params": []
},
{
"method": "GET",
"route": "/api/action/leon/random_number/run",
"params": []
},
{
"method": "POST",
"route": "/api/action/productivity/todo_list/create_list",

View File

View File

@ -0,0 +1,14 @@
{
"actions": {
"run": {
"utterance_samples": [
"Give me a random number",
"Give me a number",
"Tell me a random number",
"Choose a number",
"Pick a number"
]
}
},
"answers": { }
}

View File

@ -0,0 +1,14 @@
{
"actions": {
"run": {
"utterance_samples": [
"Donne-moi un nombre aléatoire",
"Donne-moi un nombre",
"Dis-moi un nombre aléatoire",
"Choisis un nombre",
"Pioche un nombre"
]
}
},
"answers": { }
}

View File

@ -0,0 +1,11 @@
{
"name": "Random Number",
"bridge": "python",
"version": "1.0.0",
"description": "Leon gives a random number.",
"author": {
"name": "Louis Grenard",
"email": "louis.grenard@gmail.com",
"url": "https://github.com/louistiti"
}
}

View File

@ -0,0 +1,10 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import utils
from random import randint
def run(string, entities):
"""Leon gives a random number"""
return utils.output('end', 'success', randint(0, 100))

View File

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

View File