mycroft-core/mycroft/skills/__main__.py

180 lines
5.8 KiB
Python
Raw Normal View History

Change to Apache 2.0 license from GPLv3.0 This commit officially switches the mycroft-core repository from GPLv3.0 licensing to Apache 2.0. All dependencies on GPL'ed code have been removed and we have contacted all previous contributors with still-existing code in the repository to agree to this change. Going forward, all contributors will sign a Contributor License Agreement (CLA) by visiting https://mycroft.ai/cla, then they will be included in the Mycroft Project's overall Contributor list, found at: https://github.com/MycroftAI/contributors. This cleanly protects the project, the contributor and all who use the technology to build upon. Futher discussion can be found at this blog post: https://mycroft.ai/blog/right-license/ This commit also removes all __author__="" from the code. These lines are painful to maintain and the etiquette surrounding their maintainence is unclear. Do you remove a name from the list if the last line of code the wrote gets replaced? Etc. Now all contributors are publicly acknowledged in the aforementioned repo, and actual authorship is maintained by Github in a much more effective and elegant way! Finally, a few references to "Mycroft AI" were changed to the correct legal entity name "Mycroft AI Inc." ==== Fixed Issues ==== #403 Update License.md and file headers to Apache 2.0 #400 Update LICENSE.md ==== Documentation Notes ==== Deprecated the ScheduledSkill and ScheduledCRUDSkill classes. These capabilities have been superceded by the more flexible MycroftSkill class methods schedule_event(), schedule_repeating_event(), update_event(), and cancel_event().
2017-10-04 06:28:44 +00:00
# Copyright 2017 Mycroft AI Inc.
#
Change to Apache 2.0 license from GPLv3.0 This commit officially switches the mycroft-core repository from GPLv3.0 licensing to Apache 2.0. All dependencies on GPL'ed code have been removed and we have contacted all previous contributors with still-existing code in the repository to agree to this change. Going forward, all contributors will sign a Contributor License Agreement (CLA) by visiting https://mycroft.ai/cla, then they will be included in the Mycroft Project's overall Contributor list, found at: https://github.com/MycroftAI/contributors. This cleanly protects the project, the contributor and all who use the technology to build upon. Futher discussion can be found at this blog post: https://mycroft.ai/blog/right-license/ This commit also removes all __author__="" from the code. These lines are painful to maintain and the etiquette surrounding their maintainence is unclear. Do you remove a name from the list if the last line of code the wrote gets replaced? Etc. Now all contributors are publicly acknowledged in the aforementioned repo, and actual authorship is maintained by Github in a much more effective and elegant way! Finally, a few references to "Mycroft AI" were changed to the correct legal entity name "Mycroft AI Inc." ==== Fixed Issues ==== #403 Update License.md and file headers to Apache 2.0 #400 Update LICENSE.md ==== Documentation Notes ==== Deprecated the ScheduledSkill and ScheduledCRUDSkill classes. These capabilities have been superceded by the more flexible MycroftSkill class methods schedule_event(), schedule_repeating_event(), update_event(), and cancel_event().
2017-10-04 06:28:44 +00:00
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
Change to Apache 2.0 license from GPLv3.0 This commit officially switches the mycroft-core repository from GPLv3.0 licensing to Apache 2.0. All dependencies on GPL'ed code have been removed and we have contacted all previous contributors with still-existing code in the repository to agree to this change. Going forward, all contributors will sign a Contributor License Agreement (CLA) by visiting https://mycroft.ai/cla, then they will be included in the Mycroft Project's overall Contributor list, found at: https://github.com/MycroftAI/contributors. This cleanly protects the project, the contributor and all who use the technology to build upon. Futher discussion can be found at this blog post: https://mycroft.ai/blog/right-license/ This commit also removes all __author__="" from the code. These lines are painful to maintain and the etiquette surrounding their maintainence is unclear. Do you remove a name from the list if the last line of code the wrote gets replaced? Etc. Now all contributors are publicly acknowledged in the aforementioned repo, and actual authorship is maintained by Github in a much more effective and elegant way! Finally, a few references to "Mycroft AI" were changed to the correct legal entity name "Mycroft AI Inc." ==== Fixed Issues ==== #403 Update License.md and file headers to Apache 2.0 #400 Update LICENSE.md ==== Documentation Notes ==== Deprecated the ScheduledSkill and ScheduledCRUDSkill classes. These capabilities have been superceded by the more flexible MycroftSkill class methods schedule_event(), schedule_repeating_event(), update_event(), and cancel_event().
2017-10-04 06:28:44 +00:00
# http://www.apache.org/licenses/LICENSE-2.0
#
Change to Apache 2.0 license from GPLv3.0 This commit officially switches the mycroft-core repository from GPLv3.0 licensing to Apache 2.0. All dependencies on GPL'ed code have been removed and we have contacted all previous contributors with still-existing code in the repository to agree to this change. Going forward, all contributors will sign a Contributor License Agreement (CLA) by visiting https://mycroft.ai/cla, then they will be included in the Mycroft Project's overall Contributor list, found at: https://github.com/MycroftAI/contributors. This cleanly protects the project, the contributor and all who use the technology to build upon. Futher discussion can be found at this blog post: https://mycroft.ai/blog/right-license/ This commit also removes all __author__="" from the code. These lines are painful to maintain and the etiquette surrounding their maintainence is unclear. Do you remove a name from the list if the last line of code the wrote gets replaced? Etc. Now all contributors are publicly acknowledged in the aforementioned repo, and actual authorship is maintained by Github in a much more effective and elegant way! Finally, a few references to "Mycroft AI" were changed to the correct legal entity name "Mycroft AI Inc." ==== Fixed Issues ==== #403 Update License.md and file headers to Apache 2.0 #400 Update LICENSE.md ==== Documentation Notes ==== Deprecated the ScheduledSkill and ScheduledCRUDSkill classes. These capabilities have been superceded by the more flexible MycroftSkill class methods schedule_event(), schedule_repeating_event(), update_event(), and cancel_event().
2017-10-04 06:28:44 +00:00
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
2017-02-21 05:43:50 +00:00
import time
from threading import Timer
SkillManager, msm messagebus notifications Significantly reworked the loading/updating of Skills. Unified all management under a single SkillManager class. This class runs as a thread that initially loads, upgrades (via MSM) and reloads skills. Removed the independent threads that were being run. The skill updating still happens once an hour, but works in conjunction with the scan to reload modified skills. Also added messagebus notifications from MSM so mycroft-core can pause reloading skills until the installation is complete. Added a new mycroft.messagebus.send module to allow command line interaction with the messagebus, e.g.: python -m mycroft.messagebus.send mycroft.wifi.start python -m mycroft.messagebus.send speak '{"utterance":"hello"}' ==== Fixed Issues ==== MSM installs that have PIP dependencies were failing, as the load would occur after code was retrieved but before PIP install completed. Restart was required to load new skills. ==== Tech Notes ==== TODO: Change the way we manage modules. The auto-load of the remote configuration for the module is silly, slow and wasteful. I made the WebsocketClient.build_url() method static in anticipation of being able to do this more efficiently when the submodule load doesn't hit the remove API automatically. ==== Localization Notes ==== Modified 'sorry I couldn't install default skills' message. ==== Protocol Notes ==== MSM now generates: msm.updating msm.installing msm.install.succeeded { "skill" : name } msm.install.failed { "skill" : name, "error" : code } msm.installed msm.updated msm.removing msm.remove.succeeded { "skill" : name } msm.remove.failed { "skill" : name, "error" : code } msm.removed An update can now be forced by posting 'skillmanager.update' to the messagebus.
2017-10-13 07:21:58 +00:00
import mycroft.lock
from mycroft import dialog
from mycroft.api import is_paired, BackendDown
from mycroft.client.enclosure.api import EnclosureAPI
from mycroft.configuration import Configuration
In the 1970s computer users had to understand the arcane syntax of the machines they used. They programed their computers using the machine's native language and hardly gave it a thought. The 1980s birthed a new form of interaction between computers and users. For the first time computers became capable of understanding the most basic form of human communication - pointing and grunting. The mouse and the GUI revolutionized computing and made computers accessible to the masses. We have now entered a third era. We are rapidly approaching a time when computer systems will understand human language and respond using the most natural form of human communication – speech. This is an important development. Some might even call it revolutionary. Despite its importance, however, the technologies that will underpin this new method of interaction are the property of major tech firms who don't necessarily have the public's best interests at heart. Not anymore. Meet Mycroft – the worlds first open source natural language platform. Mycroft understands human language and responds with speech. It is being designed to run on anything from a phone to an automobile and will change the way we interact with open source technologies in profound ways. Our goal here at Mycroft is to improve this technology to the point that when you interact with the software it is impossible to tell if you are talking to a human or a machine. This initial release of the Mycroft software represents a significant effort by the Mycroft community to give the open source world access to this important technology. We are all hoping that the software will be useful to the public and will help to usher in a new era of human machine interaction. Our community welcomes everyone to use Mycroft, improve the software and contribute back to the project. With your help and support we can truly make Mycroft an AI for everyone. Joshua W Montgomery – May 17, 2016
2016-05-20 14:16:01 +00:00
from mycroft.messagebus.client.ws import WebsocketClient
2017-04-06 23:08:23 +00:00
from mycroft.messagebus.message import Message
from mycroft.util import (
connected, wait_while_speaking, reset_sigint_handler,
create_echo_function, create_daemon, wait_for_exit_signal
)
from .skill_manager import SkillManager
from .core import FallbackSkill
from .event_scheduler import EventScheduler
from .intent_service import IntentService
from .padatious_service import PadatiousService
In the 1970s computer users had to understand the arcane syntax of the machines they used. They programed their computers using the machine's native language and hardly gave it a thought. The 1980s birthed a new form of interaction between computers and users. For the first time computers became capable of understanding the most basic form of human communication - pointing and grunting. The mouse and the GUI revolutionized computing and made computers accessible to the masses. We have now entered a third era. We are rapidly approaching a time when computer systems will understand human language and respond using the most natural form of human communication – speech. This is an important development. Some might even call it revolutionary. Despite its importance, however, the technologies that will underpin this new method of interaction are the property of major tech firms who don't necessarily have the public's best interests at heart. Not anymore. Meet Mycroft – the worlds first open source natural language platform. Mycroft understands human language and responds with speech. It is being designed to run on anything from a phone to an automobile and will change the way we interact with open source technologies in profound ways. Our goal here at Mycroft is to improve this technology to the point that when you interact with the software it is impossible to tell if you are talking to a human or a machine. This initial release of the Mycroft software represents a significant effort by the Mycroft community to give the open source world access to this important technology. We are all hoping that the software will be useful to the public and will help to usher in a new era of human machine interaction. Our community welcomes everyone to use Mycroft, improve the software and contribute back to the project. With your help and support we can truly make Mycroft an AI for everyone. Joshua W Montgomery – May 17, 2016
2016-05-20 14:16:01 +00:00
bus = None # Mycroft messagebus reference, see "mycroft.messagebus"
event_scheduler = None
SkillManager, msm messagebus notifications Significantly reworked the loading/updating of Skills. Unified all management under a single SkillManager class. This class runs as a thread that initially loads, upgrades (via MSM) and reloads skills. Removed the independent threads that were being run. The skill updating still happens once an hour, but works in conjunction with the scan to reload modified skills. Also added messagebus notifications from MSM so mycroft-core can pause reloading skills until the installation is complete. Added a new mycroft.messagebus.send module to allow command line interaction with the messagebus, e.g.: python -m mycroft.messagebus.send mycroft.wifi.start python -m mycroft.messagebus.send speak '{"utterance":"hello"}' ==== Fixed Issues ==== MSM installs that have PIP dependencies were failing, as the load would occur after code was retrieved but before PIP install completed. Restart was required to load new skills. ==== Tech Notes ==== TODO: Change the way we manage modules. The auto-load of the remote configuration for the module is silly, slow and wasteful. I made the WebsocketClient.build_url() method static in anticipation of being able to do this more efficiently when the submodule load doesn't hit the remove API automatically. ==== Localization Notes ==== Modified 'sorry I couldn't install default skills' message. ==== Protocol Notes ==== MSM now generates: msm.updating msm.installing msm.install.succeeded { "skill" : name } msm.install.failed { "skill" : name, "error" : code } msm.installed msm.updated msm.removing msm.remove.succeeded { "skill" : name } msm.remove.failed { "skill" : name, "error" : code } msm.removed An update can now be forced by posting 'skillmanager.update' to the messagebus.
2017-10-13 07:21:58 +00:00
skill_manager = None
# Remember "now" at startup. Used to detect clock changes.
start_ticks = time.monotonic()
start_clock = time.time()
2017-03-14 16:12:34 +00:00
2017-02-21 05:43:50 +00:00
def connect():
global bus
bus.run_forever()
2017-02-21 05:43:50 +00:00
def _starting_up():
"""
Start loading skills.
Starts
SkillManager, msm messagebus notifications Significantly reworked the loading/updating of Skills. Unified all management under a single SkillManager class. This class runs as a thread that initially loads, upgrades (via MSM) and reloads skills. Removed the independent threads that were being run. The skill updating still happens once an hour, but works in conjunction with the scan to reload modified skills. Also added messagebus notifications from MSM so mycroft-core can pause reloading skills until the installation is complete. Added a new mycroft.messagebus.send module to allow command line interaction with the messagebus, e.g.: python -m mycroft.messagebus.send mycroft.wifi.start python -m mycroft.messagebus.send speak '{"utterance":"hello"}' ==== Fixed Issues ==== MSM installs that have PIP dependencies were failing, as the load would occur after code was retrieved but before PIP install completed. Restart was required to load new skills. ==== Tech Notes ==== TODO: Change the way we manage modules. The auto-load of the remote configuration for the module is silly, slow and wasteful. I made the WebsocketClient.build_url() method static in anticipation of being able to do this more efficiently when the submodule load doesn't hit the remove API automatically. ==== Localization Notes ==== Modified 'sorry I couldn't install default skills' message. ==== Protocol Notes ==== MSM now generates: msm.updating msm.installing msm.install.succeeded { "skill" : name } msm.install.failed { "skill" : name, "error" : code } msm.installed msm.updated msm.removing msm.remove.succeeded { "skill" : name } msm.remove.failed { "skill" : name, "error" : code } msm.removed An update can now be forced by posting 'skillmanager.update' to the messagebus.
2017-10-13 07:21:58 +00:00
- SkillManager to load/reloading of skills when needed
- a timer to check for internet connection
- adapt intent service
- padatious intent service
"""
global bus, skill_manager, event_scheduler
2017-02-21 05:43:50 +00:00
bus.on('intent_failure', FallbackSkill.make_intent_failure_handler(bus))
# Create the Intent manager, which converts utterances to intents
# This is the heart of the voice invoked skill system
service = IntentService(bus)
PadatiousService(bus, service)
event_scheduler = EventScheduler(bus)
SkillManager, msm messagebus notifications Significantly reworked the loading/updating of Skills. Unified all management under a single SkillManager class. This class runs as a thread that initially loads, upgrades (via MSM) and reloads skills. Removed the independent threads that were being run. The skill updating still happens once an hour, but works in conjunction with the scan to reload modified skills. Also added messagebus notifications from MSM so mycroft-core can pause reloading skills until the installation is complete. Added a new mycroft.messagebus.send module to allow command line interaction with the messagebus, e.g.: python -m mycroft.messagebus.send mycroft.wifi.start python -m mycroft.messagebus.send speak '{"utterance":"hello"}' ==== Fixed Issues ==== MSM installs that have PIP dependencies were failing, as the load would occur after code was retrieved but before PIP install completed. Restart was required to load new skills. ==== Tech Notes ==== TODO: Change the way we manage modules. The auto-load of the remote configuration for the module is silly, slow and wasteful. I made the WebsocketClient.build_url() method static in anticipation of being able to do this more efficiently when the submodule load doesn't hit the remove API automatically. ==== Localization Notes ==== Modified 'sorry I couldn't install default skills' message. ==== Protocol Notes ==== MSM now generates: msm.updating msm.installing msm.install.succeeded { "skill" : name } msm.install.failed { "skill" : name, "error" : code } msm.installed msm.updated msm.removing msm.remove.succeeded { "skill" : name } msm.remove.failed { "skill" : name, "error" : code } msm.removed An update can now be forced by posting 'skillmanager.update' to the messagebus.
2017-10-13 07:21:58 +00:00
# Create a thread that monitors the loaded skills, looking for updates
skill_manager = SkillManager(bus)
SkillManager, msm messagebus notifications Significantly reworked the loading/updating of Skills. Unified all management under a single SkillManager class. This class runs as a thread that initially loads, upgrades (via MSM) and reloads skills. Removed the independent threads that were being run. The skill updating still happens once an hour, but works in conjunction with the scan to reload modified skills. Also added messagebus notifications from MSM so mycroft-core can pause reloading skills until the installation is complete. Added a new mycroft.messagebus.send module to allow command line interaction with the messagebus, e.g.: python -m mycroft.messagebus.send mycroft.wifi.start python -m mycroft.messagebus.send speak '{"utterance":"hello"}' ==== Fixed Issues ==== MSM installs that have PIP dependencies were failing, as the load would occur after code was retrieved but before PIP install completed. Restart was required to load new skills. ==== Tech Notes ==== TODO: Change the way we manage modules. The auto-load of the remote configuration for the module is silly, slow and wasteful. I made the WebsocketClient.build_url() method static in anticipation of being able to do this more efficiently when the submodule load doesn't hit the remove API automatically. ==== Localization Notes ==== Modified 'sorry I couldn't install default skills' message. ==== Protocol Notes ==== MSM now generates: msm.updating msm.installing msm.install.succeeded { "skill" : name } msm.install.failed { "skill" : name, "error" : code } msm.installed msm.updated msm.removing msm.remove.succeeded { "skill" : name } msm.remove.failed { "skill" : name, "error" : code } msm.removed An update can now be forced by posting 'skillmanager.update' to the messagebus.
2017-10-13 07:21:58 +00:00
skill_manager.daemon = True
# Wait until skills have been loaded once before starting to check
# network connection
skill_manager.load_priority()
skill_manager.start()
check_connection()
In the 1970s computer users had to understand the arcane syntax of the machines they used. They programed their computers using the machine's native language and hardly gave it a thought. The 1980s birthed a new form of interaction between computers and users. For the first time computers became capable of understanding the most basic form of human communication - pointing and grunting. The mouse and the GUI revolutionized computing and made computers accessible to the masses. We have now entered a third era. We are rapidly approaching a time when computer systems will understand human language and respond using the most natural form of human communication – speech. This is an important development. Some might even call it revolutionary. Despite its importance, however, the technologies that will underpin this new method of interaction are the property of major tech firms who don't necessarily have the public's best interests at heart. Not anymore. Meet Mycroft – the worlds first open source natural language platform. Mycroft understands human language and responds with speech. It is being designed to run on anything from a phone to an automobile and will change the way we interact with open source technologies in profound ways. Our goal here at Mycroft is to improve this technology to the point that when you interact with the software it is impossible to tell if you are talking to a human or a machine. This initial release of the Mycroft software represents a significant effort by the Mycroft community to give the open source world access to this important technology. We are all hoping that the software will be useful to the public and will help to usher in a new era of human machine interaction. Our community welcomes everyone to use Mycroft, improve the software and contribute back to the project. With your help and support we can truly make Mycroft an AI for everyone. Joshua W Montgomery – May 17, 2016
2016-05-20 14:16:01 +00:00
2017-04-25 22:18:43 +00:00
def check_connection():
2017-08-21 15:05:03 +00:00
"""
Check for network connection. If not paired trigger pairing.
Runs as a Timer every second until connection is detected.
"""
2017-04-25 22:18:43 +00:00
if connected():
enclosure = EnclosureAPI(bus)
if is_paired():
# Skip the sync message when unpaired because the prompt to go to
# home.mycrof.ai will be displayed by the pairing skill
enclosure.mouth_text(dialog.get("message_synching.clock"))
2018-02-25 19:53:04 +00:00
# Force a sync of the local clock with the internet
2018-02-25 19:53:04 +00:00
config = Configuration.get()
platform = config['enclosure'].get("platform", "unknown")
if platform in ['mycroft_mark_1', 'picroft']:
bus.emit(Message("system.ntp.sync"))
time.sleep(15) # TODO: Generate/listen for a message response...
# Check if the time skewed significantly. If so, reboot
skew = abs((time.monotonic() - start_ticks) -
(time.time() - start_clock))
if skew > 60 * 60:
# Time moved by over an hour in the NTP sync. Force a reboot to
# prevent weird things from occcurring due to the 'time warp'.
#
data = {'utterance': dialog.get("time.changed.reboot")}
bus.emit(Message("speak", data))
wait_while_speaking()
# provide visual indicators of the reboot
enclosure.mouth_text(dialog.get("message_rebooting"))
enclosure.eyes_color(70, 65, 69) # soft gray
enclosure.eyes_spin()
# give the system time to finish processing enclosure messages
time.sleep(1.0)
# reboot
bus.emit(Message("system.reboot"))
return
else:
bus.emit(Message("enclosure.mouth.reset"))
time.sleep(0.5)
bus.emit(Message('mycroft.internet.connected'))
# check for pairing, if not automatically start pairing
try:
if not is_paired(ignore_errors=False):
payload = {
'utterances': ["pair my device"],
'lang': "en-us"
}
bus.emit(Message("recognizer_loop:utterance", payload))
else:
from mycroft.api import DeviceApi
api = DeviceApi()
api.update_version()
except BackendDown:
data = {'utterance': dialog.get("backend.down")}
bus.emit(Message("speak", data))
bus.emit(Message("backend.down"))
2017-04-25 22:18:43 +00:00
else:
thread = Timer(1, check_connection)
thread.daemon = True
thread.start()
In the 1970s computer users had to understand the arcane syntax of the machines they used. They programed their computers using the machine's native language and hardly gave it a thought. The 1980s birthed a new form of interaction between computers and users. For the first time computers became capable of understanding the most basic form of human communication - pointing and grunting. The mouse and the GUI revolutionized computing and made computers accessible to the masses. We have now entered a third era. We are rapidly approaching a time when computer systems will understand human language and respond using the most natural form of human communication – speech. This is an important development. Some might even call it revolutionary. Despite its importance, however, the technologies that will underpin this new method of interaction are the property of major tech firms who don't necessarily have the public's best interests at heart. Not anymore. Meet Mycroft – the worlds first open source natural language platform. Mycroft understands human language and responds with speech. It is being designed to run on anything from a phone to an automobile and will change the way we interact with open source technologies in profound ways. Our goal here at Mycroft is to improve this technology to the point that when you interact with the software it is impossible to tell if you are talking to a human or a machine. This initial release of the Mycroft software represents a significant effort by the Mycroft community to give the open source world access to this important technology. We are all hoping that the software will be useful to the public and will help to usher in a new era of human machine interaction. Our community welcomes everyone to use Mycroft, improve the software and contribute back to the project. With your help and support we can truly make Mycroft an AI for everyone. Joshua W Montgomery – May 17, 2016
2016-05-20 14:16:01 +00:00
def main():
global bus
reset_sigint_handler()
SkillManager, msm messagebus notifications Significantly reworked the loading/updating of Skills. Unified all management under a single SkillManager class. This class runs as a thread that initially loads, upgrades (via MSM) and reloads skills. Removed the independent threads that were being run. The skill updating still happens once an hour, but works in conjunction with the scan to reload modified skills. Also added messagebus notifications from MSM so mycroft-core can pause reloading skills until the installation is complete. Added a new mycroft.messagebus.send module to allow command line interaction with the messagebus, e.g.: python -m mycroft.messagebus.send mycroft.wifi.start python -m mycroft.messagebus.send speak '{"utterance":"hello"}' ==== Fixed Issues ==== MSM installs that have PIP dependencies were failing, as the load would occur after code was retrieved but before PIP install completed. Restart was required to load new skills. ==== Tech Notes ==== TODO: Change the way we manage modules. The auto-load of the remote configuration for the module is silly, slow and wasteful. I made the WebsocketClient.build_url() method static in anticipation of being able to do this more efficiently when the submodule load doesn't hit the remove API automatically. ==== Localization Notes ==== Modified 'sorry I couldn't install default skills' message. ==== Protocol Notes ==== MSM now generates: msm.updating msm.installing msm.install.succeeded { "skill" : name } msm.install.failed { "skill" : name, "error" : code } msm.installed msm.updated msm.removing msm.remove.succeeded { "skill" : name } msm.remove.failed { "skill" : name, "error" : code } msm.removed An update can now be forced by posting 'skillmanager.update' to the messagebus.
2017-10-13 07:21:58 +00:00
# Create PID file, prevent multiple instancesof this service
2017-10-13 09:22:01 +00:00
mycroft.lock.Lock('skills')
# Connect this Skill management process to the Mycroft Messagebus
bus = WebsocketClient()
Configuration.init(bus)
2017-04-06 17:45:28 +00:00
bus.on('message', create_echo_function('SKILLS'))
# Startup will be called after the connection with the Messagebus is done
bus.once('open', _starting_up)
In the 1970s computer users had to understand the arcane syntax of the machines they used. They programed their computers using the machine's native language and hardly gave it a thought. The 1980s birthed a new form of interaction between computers and users. For the first time computers became capable of understanding the most basic form of human communication - pointing and grunting. The mouse and the GUI revolutionized computing and made computers accessible to the masses. We have now entered a third era. We are rapidly approaching a time when computer systems will understand human language and respond using the most natural form of human communication – speech. This is an important development. Some might even call it revolutionary. Despite its importance, however, the technologies that will underpin this new method of interaction are the property of major tech firms who don't necessarily have the public's best interests at heart. Not anymore. Meet Mycroft – the worlds first open source natural language platform. Mycroft understands human language and responds with speech. It is being designed to run on anything from a phone to an automobile and will change the way we interact with open source technologies in profound ways. Our goal here at Mycroft is to improve this technology to the point that when you interact with the software it is impossible to tell if you are talking to a human or a machine. This initial release of the Mycroft software represents a significant effort by the Mycroft community to give the open source world access to this important technology. We are all hoping that the software will be useful to the public and will help to usher in a new era of human machine interaction. Our community welcomes everyone to use Mycroft, improve the software and contribute back to the project. With your help and support we can truly make Mycroft an AI for everyone. Joshua W Montgomery – May 17, 2016
2016-05-20 14:16:01 +00:00
create_daemon(bus.run_forever)
wait_for_exit_signal()
shutdown()
2017-04-06 17:45:28 +00:00
2017-04-17 17:25:27 +00:00
def shutdown():
if event_scheduler:
event_scheduler.shutdown()
# Terminate all running threads that update skills
if skill_manager:
skill_manager.stop()
skill_manager.join()
In the 1970s computer users had to understand the arcane syntax of the machines they used. They programed their computers using the machine's native language and hardly gave it a thought. The 1980s birthed a new form of interaction between computers and users. For the first time computers became capable of understanding the most basic form of human communication - pointing and grunting. The mouse and the GUI revolutionized computing and made computers accessible to the masses. We have now entered a third era. We are rapidly approaching a time when computer systems will understand human language and respond using the most natural form of human communication – speech. This is an important development. Some might even call it revolutionary. Despite its importance, however, the technologies that will underpin this new method of interaction are the property of major tech firms who don't necessarily have the public's best interests at heart. Not anymore. Meet Mycroft – the worlds first open source natural language platform. Mycroft understands human language and responds with speech. It is being designed to run on anything from a phone to an automobile and will change the way we interact with open source technologies in profound ways. Our goal here at Mycroft is to improve this technology to the point that when you interact with the software it is impossible to tell if you are talking to a human or a machine. This initial release of the Mycroft software represents a significant effort by the Mycroft community to give the open source world access to this important technology. We are all hoping that the software will be useful to the public and will help to usher in a new era of human machine interaction. Our community welcomes everyone to use Mycroft, improve the software and contribute back to the project. With your help and support we can truly make Mycroft an AI for everyone. Joshua W Montgomery – May 17, 2016
2016-05-20 14:16:01 +00:00
if __name__ == "__main__":
main()