Updated decide skill

This commit is contained in:
Mathieu 2021-09-08 14:53:27 +02:00
parent f28b927bc5
commit a6144c65e8
8 changed files with 4 additions and 22 deletions

View File

@ -1,22 +1,17 @@
import random
from adapt.intent import IntentBuilder
from jarvis.skills import Skill, SkillRegistering
from jarvis.skills.decorators import intent_handler
from jarvis.skills.decorators import intent_file_handler
class DecideSkill(Skill, metaclass=SkillRegistering):
def __init__(self, data=dict):
super().__init__("DecideSkill", data)
@intent_handler(IntentBuilder("DecideIntent").require("choice1").require("choice2").optionally("OrKeyword"))
# @intent_file_handler("decide.intent", "DecideIntent")
def handle_decide(self, data):
@intent_file_handler("decide.intent", "DecideIntent")
def handle_decide_intent(self, data):
print("decide")
print(data)
if 'choice1' in data and 'choice2' in data:
choice = bool(random.getrandbits(1))

View File

@ -1,2 +0,0 @@
(.* (?P<choice1>.*) or (?P<dummy>.*))
between ((?P<choice1>.*) and (?P<dummy>.*))

View File

@ -1,2 +0,0 @@
(.* (?P<dummy2>.*) or (?P<choice2>.*))
between ((?P<dummy2>.*) and (?P<choice2>.*))

View File

@ -1 +0,0 @@
(?P<choice1>\w+|(\w+ au \w+)) (?:ou|et) (?P<dummy1>\w+|(\w+ au \w+))

View File

@ -1 +0,0 @@
(?P<dummy2>\w+|(\w+ au \w+)) (?:ou|et) (?P<choice2>\w+|(\w+ au \w+))

View File

@ -1,4 +0,0 @@
Decide
What should I wear
What should I eat
game

View File

@ -1,3 +0,0 @@
ou
et
entre

View File

@ -4,4 +4,4 @@ tu pense (que|) c'est {choice1} ou {choice2} qui gagne
entre {choice1} et {choice2}
{choice1} ou {choice2}
tu prefère (le|les|la) {choice1} (ou|ou bien) (le|les|la) {choice2}
choisi entre {choice1} et {choice2}
(choisi|choisis) entre {choice1} et {choice2}