Hi Carsten,
Many thanks for your response. I was asking about the mechanics of deploying my skill for testing. Sorry for being unclear with my question. I subsequently learned that I could copy my skill into the /opt/mycroft/skills folder and have it load. I have done so but the skill is not triggering.
I am appending the code and will try to attach a log.
from adapt.intent import IntentBuilder
from mycroft.skills.core import MycroftSkill
from mycroft.util.log import getLogger
author = ‘Pranav’
Logger: used for debug lines, like “LOGGER.debug(xyz)”. These
statements will show up in the command line when running Mycroft.
LOGGER = getLogger(name)
The logic of each skill is contained within its own class, which inherits
base methods from the MycroftSkill class with the syntax you can see below:
“class ____Skill(MycroftSkill)”
import os, base64
from mycroft import MycroftSkill, intent_handler
import requests
class AskCiso(MycroftSkill):
def init(self):
super(AskCiso, self).init(name=“AskCiso”)
@intent_handler(IntentBuilder("").require("ask ciso").require("Words"))
def generate_session(self):
return base64.b64encode(os.urandom(32))
def speak_back(self, message):
# Get everything after say/speak/etc. and speak it back
LOGGER.debug("work routine invoked")
words = message.data.get('utterance').split(message.data['ask ciso'])[1]
words = words.strip()
payload = {'question': words, 'sessionid': self.generate_session()}
LOGGER.debug("about to look up bot")
r = requests.get('http://104.236.77.142:5001/api/v1.0/ask', params=payload)
spt=r.json()
self.speak(spt)
def stop(self):
pass
def create_skill():
return AskCiso()
The log is below.
14:28:23.042 - mycroft.skills.core:load_skill:126 - INFO - ATTEMPTING TO LOAD SKILL: skill-ask-ciso with ID 1920875901
14:28:23.052 - mycroft.skills.core:init_dialog:841 - DEBUG - No dialog loaded, /opt/mycroft/skills/skill-ask-ciso/dialog/en-us does not exist
14:28:23.068 - mycroft.skills.core:load_skill:144 - INFO - Loaded skill-ask-ciso
14:28:23.071 - SKILLS - DEBUG - {“type”: “register_vocab”, “data”: {“start”: “ask ciso”, “end”: “Speak”}, “context”: null}
14:28:23.094 - SKILLS - DEBUG - {“type”: “register_vocab”, “data”: {“regex”: “ask ciso (?P.*)”}, “context”: null}
14:28:23.105 - SKILLS - DEBUG - {“type”: “register_intent”, “data”: {“at_least_one”: [], “requires”: [[“ask ciso”, “ask ciso”], [“Words”, “Words”]], “optional”: [], “name”: “1920875901:generate_session”}, “context”: null}
14:32:22.262 - SKILLS - DEBUG - {“type”: “recognizer_loop:utterance”, “data”: {“lang”: “en-us”, “utterances”: ["“ask ciso what is cyber security”"]}, “context”: null}
14:32:22.289 - SKILLS - DEBUG - {“type”: “skill.converse.request”, “data”: {“lang”: “en-us”, “skill_id”: 1017122086, “utterances”: ["“ask ciso what is cyber security”"]}, “context”: null}
14:32:22.457 - SKILLS - DEBUG - {“type”: “-1492484506:speak_back”, “data”: {“confidence”: 0.375, “target”: null, “intent_type”: “-1492484506:speak_back”, “Words”: "what is cyber security “”, “tags”: [{“end_token”: 2, “start_token”: 1, “from_context”: false, “entities”: [{“confidence”: 1.0, “data”: [[“ask ciso”, “Speak”]], “key”: “ask ciso”, “match”: “ask ciso”}], “key”: “ask ciso”, “match”: “ask ciso”}, {“end_token”: 7, “start_token”: 3, “confidence”: 0.5, “from_context”: false, “entities”: [{“confidence”: 0.5, “data”: [["what is cyber security “”, “Words”]], “key”: "what is cyber security “”, “match”: "what is cyber security “”}], “key”: "what is cyber security “”, “match”: "what is cyber security “”}], “utterance”: ““ask ciso what is cyber security””, “Speak”: “ask ciso”}, “context”: {“target”: null}}