-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin System #130
Comments
Never seen Yapsy before--thanks for point it out! I like this idea. Unclear to me how much dev work it would require (probably not a ton), but it seems like we could plug this in fairly easily. Maybe the majority of the effort would need to be in re-documenting everything? |
Well, it depends. To start, we could just a PluginManager class and a Plugin class that responds to transcribed speech (named SpeechHandlerPlugin or something like that) and which will act as base class that all current plugins inhertit from. Later, other types of plugins could be added, e.g.:
|
General thoughtsI'm a big fan of modularity and customizability, so I think Jasper should only be the core software that connects the stuff together. Everything else should be put into plugins (which does not mean that we can't put a lot of useful plugins into the standard distribution). So, there should be a number of different plugin types:
Every plugin should have a '[Dependencies]' section in its description file that lists the depencies (obviously). This way, we can keep jasper's core depencies very small (right now we already need a bunch of pypi packages that are required by modules that the user might not want to use at all). ExampleThe Google STT/TTS services do not need anything except a working internet connection and an API key, so if you use that, you don't have to install anything else. Also, this gives us the possibility to make jasper more platform independent (If you use the Google TTS, Dragon Naturally Speaking or Windows Speech Recognition instead of Pocketsphinx, Jasper could easily run on Windows). Plugin types1. Speech-to-Text (STT) pluginsThese are the plugin that do the transcription. There can be various ones, e.g.:
They inhertit from a some kind of abstract class (e.g. "AbstractSTTPlugin"), that acts as an interface and requires the subclasses to implement a 2. Text-to-Speech (TTS) pluginsThese to the opposite: they take some text and transform it into speech, e.g.: They inhertit from a some kind of abstract class (e.g. "AbstractTTSPlugin"), that acts as an interface and requires the subclasses to implement a 3. InputHandler pluginsThese are plugins like most modules in 4. EventHandler pluginThese plugins Handle events instead of text (i.e. transcribed speech) input. Event could be:
They either do something instantly (like sending you an SMS) or put some phrase into the input queue so that it can be handled by one of the InputHandler plugins.
5./6. I/O pluginsI'm not so sure about these (IMHO they can be postponed to a later version or left out completely, if you think that these go beyond the scope of Jasper). The basic idea is that they control how text is fed into Jasper and how it's put out. Basically,
To archieve this, we could stop passing around input phrases as string but rather as |
An example implementation for the STT stuff can be found here. [Disclaimer: Couldn't test it.] |
Would be nice to handle priorities on the modules through the plugin manager too. |
Also, events should have configurable "Do Not Disturb" hours. |
Superseded by issue #280. |
Guys, do you know Chatterbot? DO you know if there is a way to implement chatterbot in Jasper? Or do you know how to teach Jasper new dialogs? |
Jasper should use some kind of plugin architecture (e.g. Yapsy), so that it's easy to activate, deactive and add modules.
The Plugin interface class could also define some abstract methods (via the
@abstractmethod
decorator), to tell Plugin developers, which methods are needed for a working plugin.This would also make it easier for the main code to access available/activated plugins (e.g. in
brain.py
orvocabcompiler.py
), especially if we want to load plugins from dífferent locations (the jasper base plugins from the installation directory and user-installed plugins in~/.jasper-client/plugins/
).What do you think?
The text was updated successfully, but these errors were encountered: