From 30fa9719ad5ff8eed4eba37097564da3a5f8acf4 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Wed, 3 May 2023 21:04:27 -0400 Subject: [PATCH 01/30] Get the API set up and remove unneeded `start` function --- akulai/akulai.py | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/akulai/akulai.py b/akulai/akulai.py index 2b510af..faa6bef 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -8,6 +8,7 @@ import subprocess import threading import vosk +from fastapi import FastAPI class JSPlugin: @@ -116,13 +117,6 @@ def execute_command(self, command): if(not handled): self.speak("Sorry, I didn't understand that.") - def start(self): - self.speak("Hello, I am AkulAI. How can I help you today?") - # Create the listening thread - self.stop_listening = threading.Event() - self.listening_thread = threading.Thread(target=self.listen) - self.listening_thread.start() - # shut down the program and all threads def stop(self): self.stop_listening.set() @@ -133,5 +127,26 @@ def stop(self): if __name__ == '__main__': + # Create the listening thread + self.stop_listening = threading.Event() + self.listening_thread = threading.Thread(target=self.listen) + self.listening_thread.start() + + # Set up API + app = FastAPI() akulai = AkulAI() - akulai.start() + + @app.get("/speak/") + def speak(text: str): + akulai.speak(text) + return {"message": "Text synthesized"} + + @app.post("/listen/") + def listen(): + akulai.listen() + return {"message": "Listening..."} + + # Run the server for the API + os.system("uvicorn akulai:app --reload") + + akulai.speak("Hello, I am AkulAI. How can I help you today?") From 15a70efaaa52c53c15205be7627e0212295f5c80 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Wed, 3 May 2023 21:06:13 -0400 Subject: [PATCH 02/30] Update paths in API for simplicity --- akulai/akulai.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/akulai/akulai.py b/akulai/akulai.py index faa6bef..3c4d084 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -136,13 +136,13 @@ def stop(self): app = FastAPI() akulai = AkulAI() - @app.get("/speak/") - def speak(text: str): + @app.get("/") + async def speak(text: str): akulai.speak(text) return {"message": "Text synthesized"} - @app.post("/listen/") - def listen(): + @app.post("/") + async def listen(): akulai.listen() return {"message": "Listening..."} From 225dabc6e34f870a05398a9b2bbab9a6b91372f5 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Wed, 3 May 2023 21:11:51 -0400 Subject: [PATCH 03/30] Add fastapi to the dependencies --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 164e979..9161d38 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,6 @@ vosk pyaudio js2py json +fastapi[all] # Must use Python 3.10 or above, optional, only for refining code refurb From 44bb9596bdf1c4a6b52ff72fad668d466fc9af4e Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Tue, 9 May 2023 19:49:59 -0400 Subject: [PATCH 04/30] Delete makefile as it was unneeded --- makefile | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 makefile diff --git a/makefile b/makefile deleted file mode 100644 index 0552829..0000000 --- a/makefile +++ /dev/null @@ -1,14 +0,0 @@ -clean: - rm -rf akulai/akulai-plugins - rm -rf .gitmodules - -install: - cd requirements - pip install -r requirements.txt - cd .. - cd setup - python setup.py - -run: - make clean - make install \ No newline at end of file From a17a4c684c93e475dfe12845e0836041f6dc5454 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Tue, 9 May 2023 20:03:03 -0400 Subject: [PATCH 05/30] Update create_plugins.md to include code for API --- docs/create_plugins.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/create_plugins.md b/docs/create_plugins.md index 260efbe..da16bc2 100644 --- a/docs/create_plugins.md +++ b/docs/create_plugins.md @@ -17,15 +17,20 @@ description: Lorem ipsum di olor nulla quis lorem ut libero malesuada feugiat. T The dependencies may vary based on your project. Note that when listing the dependencies, list them by the name you installed them. For example, if you installed a dependency with `pip install py-example`(note that this is an example, and applies to all languages), but imported it with `import example`, you would still list the dependency `as py-example`. If you have no dependencies required to be installed, just leave it blank. +Moreover, all plugins now require calling an API whihc gives them access to teh speak and listen function, allowing them to speak and listen when needed in the plugin. For using the speak function, it requires a GET request, and for listen, it requires a POST request. I have only included GET in this so far. If, for whatever reason, you do not require this, you may skip calling the API, and it will instead print in the console. + ## Python Plugins Python plugins should be written as a function called `handle()` with one parameter, `command`, which is the text of what the user said. It should return the text of AkulAI would like to say to the user. Here is an example of a Python plugin that says "Hello, World!" when the user says "hello": ``` python +import requests + +response = requests.get('http://127.0.0.1:8000/speak') def handle(command): if "hello" in command: - return "Hello there!" + speak("Hello there!") ``` ## Javascript Plugins JavaScript plugins should read from the commandline and write to stdout using console.log(). @@ -33,12 +38,14 @@ JavaScript plugins should read from the commandline and write to stdout using co Here is an example of a JavaScript plugin that says "Hello, World!" when the user says "hello": ``` javascript +fetch('http://127.0.0.1:8000/speak') + command = "" if(process.argv.length > 2){ command = process.argv[2] } if (command.indexOf("hello") !== -1){ - console.log("Hello there!") + speak("Hello there!") } ``` If you want to check for multiple words, you can use the `.indexOf()` method multiple times and use logical operators `(&&, ||, etc)` to check if multiple conditions are met. @@ -70,10 +77,14 @@ Here is an example of a Perl plugin: ``` perl #!/usr/bin/perl +use LWP::UserAgent; + +my $ua = LWP::UserAgent->new; +my $response = $ua->get('http://127.0.0.1:8000/speak'); my $command = shift(); if($command=~/hello/){ - print("Hello there!\n"); + speak("Hello there!\n"); } ``` Perl plugins should read from the commandline and write to stdout using print(). This example uses the command variable to check if the command contains the word "hello" and if true, print a response for AkulAI to read. From ea16452044e83d5139441584c099095e9fd2fd3a Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Thu, 11 May 2023 17:13:30 -0400 Subject: [PATCH 06/30] Use sys.exit() rather than exit() --- akulai/akulai.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/akulai/akulai.py b/akulai/akulai.py index 3c4d084..ac3103b 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -8,6 +8,7 @@ import subprocess import threading import vosk +import sys from fastapi import FastAPI @@ -123,7 +124,7 @@ def stop(self): self.stream.stop_stream() self.stream.close() self.p.terminate() - exit() + sys.exit() if __name__ == '__main__': From e3c5ef5cce1e9433a4455b48714f4bb93fa87d6f Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Wed, 24 May 2023 17:09:36 -0400 Subject: [PATCH 07/30] Fixed API set up not working --- akulai/akulai.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/akulai/akulai.py b/akulai/akulai.py index ac3103b..90fab15 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -126,6 +126,9 @@ def stop(self): self.p.terminate() sys.exit() +# Set up API +app = FastAPI() +akulai = AkulAI() if __name__ == '__main__': # Create the listening thread @@ -133,20 +136,16 @@ def stop(self): self.listening_thread = threading.Thread(target=self.listen) self.listening_thread.start() - # Set up API - app = FastAPI() - akulai = AkulAI() - - @app.get("/") + @app.get("/speak/{text}") async def speak(text: str): akulai.speak(text) return {"message": "Text synthesized"} - @app.post("/") + @app.post("/listen") async def listen(): akulai.listen() return {"message": "Listening..."} - + # Run the server for the API os.system("uvicorn akulai:app --reload") From e20e814d65c297288e5815aa496f740cf664a7a9 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Thu, 25 May 2023 16:12:07 -0400 Subject: [PATCH 08/30] Automatically open the API link in browser --- akulai/akulai.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/akulai/akulai.py b/akulai/akulai.py index 90fab15..4552d23 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -10,6 +10,7 @@ import vosk import sys from fastapi import FastAPI +import webbrowser class JSPlugin: @@ -148,5 +149,5 @@ async def listen(): # Run the server for the API os.system("uvicorn akulai:app --reload") - + webbrowser.open("http://127.0.0.1:8000") akulai.speak("Hello, I am AkulAI. How can I help you today?") From 8c015129bdde655aa6d805490f595b07df7f1b0d Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Sat, 10 Jun 2023 17:32:49 -0400 Subject: [PATCH 09/30] Replace `self` with `akulai` for objects outside of the `AkulAI` class Refers to this code block: ``` # Create the listening thread akulai.stop_listening = threading.Event() akulai.listening_thread = threading.Thread(target=akulai.listen) akulai.listening_thread.start() ``` Since it is no longer in the `AkulAI` class, I made an object for it and used that instead. --- akulai/akulai.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/akulai/akulai.py b/akulai/akulai.py index 4552d23..150a669 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -133,11 +133,11 @@ def stop(self): if __name__ == '__main__': # Create the listening thread - self.stop_listening = threading.Event() - self.listening_thread = threading.Thread(target=self.listen) - self.listening_thread.start() + akulai.stop_listening = threading.Event() + akulai.listening_thread = threading.Thread(target=akulai.listen) + akulai.listening_thread.start() - @app.get("/speak/{text}") + @app.get("/speak/{text}") async def speak(text: str): akulai.speak(text) return {"message": "Text synthesized"} From 7db686a60aa401c9a22f6e4bcc54f2446c254db8 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Thu, 20 Jul 2023 20:15:01 -0400 Subject: [PATCH 10/30] Fix a line in the setup.bat script We are very close to releasing 2.0, and so I wanted to double check everything, starting with scripts. However, I noticed so many things wrong with it. This is just fixing the setup.bat file, but I also want to cut things from other scripts. For example, I am considering putting plugins in here by default, rather than having to install them. (VOSK and all the other programs would still be in the script because they are too large to include here.) --- setup/setup.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/setup.bat b/setup/setup.bat index e333db8..94554af 100644 --- a/setup/setup.bat +++ b/setup/setup.bat @@ -17,4 +17,4 @@ sudo "apt-get" "install" "-y" "nodejs" wget "http://strawberryperl.com/download/5.32.0.1/strawberry-perl-5.32.0.1-64bit.tar.bz2" tar "-xjf" "strawberry-perl-5.32.0.1-64bit.tar.bz2" ./strawberry-perl-5.32.0.1-64bit/install.pl -pip "install" "-r" "requirements.txt" +pip install -r requirements.txt From 968aec0e1090f57d021654b1d546da4b706b5405 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Thu, 27 Jul 2023 12:11:27 -0400 Subject: [PATCH 11/30] Fix setup scripts It seems the problem was that the `.gitmodules` file already had the submodule for plugins in it, so it wasn't working. It should now, although for updating plugins, I might switch from git submodules to something else. --- .gitmodules | 3 --- requirements.txt | 1 + setup/setup.py | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index cc72fac..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "akulai-plugins"] - path = akulai-plugins - url = https://github.com/Akul-AI/akulai-plugins diff --git a/requirements.txt b/requirements.txt index 9161d38..ccee342 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,6 @@ pyaudio js2py json fastapi[all] +requests # Must use Python 3.10 or above, optional, only for refining code refurb diff --git a/setup/setup.py b/setup/setup.py index 524df9b..708b15f 100644 --- a/setup/setup.py +++ b/setup/setup.py @@ -13,7 +13,7 @@ subdir = "plugins" # Use git submodules to fetch the plugins subdir in the akulai plugins repo -os.system("git submodule add {}".format(repo_url)) +os.system("git submodule add {} --name akulai-plugins".format(repo_url)) os.system("git submodule update --init --recursive") # Move the files from the subdirectory to the local "akulai/plugins" folder From c47b0ea26e4091ae01bc915c4ae1d46c1c77ef5c Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Sat, 29 Jul 2023 11:29:14 -0400 Subject: [PATCH 12/30] Change LICENSE from MIT to GNU GPLv3 --- LICENSE.md | 695 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 674 insertions(+), 21 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 300663b..e72bfdd 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,21 +1,674 @@ -MIT License - -Copyright (c) 2022 Akul-AI - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file From 64d3595781b127f98cffe4869a5d438dba8e0d45 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Sat, 29 Jul 2023 11:37:37 -0400 Subject: [PATCH 13/30] Update `README.md` --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9848361..ec6daa6 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,15 @@ If you want a more stable version (the current version is not done yet and may n ### Manual installation -First of all, download the ASR model from [here](https://alphacephei.com/vosk/models), unzip it, rename it to `vosk_model` and place it inside `models` folder, which is located in the `akulai` directory. Make sure that you have Node.js and any installation of Perl installed, and make sure cpamn (Perl's package manager) is in the system PATH for Windows. +First of all, download the ASR model from [here](https://alphacephei.com/vosk/models), unzip it, rename it to `vosk_model` and place it inside `models` folder, which is located in the `akulai` directory. Make sure that you have Node.js and any installation of Perl installed (Strawberry or System Perl recommended), and make sure `cpamn` (Perl's package manager) is in the system PATH for Windows. ### Automatic installation (with script) -Again, you may either follow the steps above, or you may use the provided python script. We have also provided a Batch (Windows CMD) and Bash (Shell) script. If you face any errors, however, please use the python script before reporting it. +Again, you may either follow the steps above, or you may use the provided python script. We have also provided a Batch (Windows CMD) and Bash (Shell) script. If you face any errors, please let us know. Keep in mind that: - - All the scripts assume you have a working installation of Python installed. + - All the scripts assume you have a working installation of Python installed. They do not provide a Python installation like they do for Strawberry Perl and Node.js. + - If one of the native scripts don't work, try using the Python script. ## How do I create a skill...?? @@ -25,7 +26,7 @@ Go to the [master-v1 branch](https://github.com/Akul-AI/akulai/tree/master-v1) f ## Contribution -You can look at the `todo.md` file (not always updated) or you can look at the issues. Make sure to check the CONTRIBUTING.md guide before making a new feature/fix, though. Thanks to all the contributors! +You can look at the `todo.md` file (not always updated) or you can look at the issues. Make sure to check the `CONTRIBUTING.md` guide before making a new feature/fix, though. Thanks to all the contributors! From 108f2114ce2245972e5bfdf4e92ec8c999b95794 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Sat, 29 Jul 2023 19:29:04 -0400 Subject: [PATCH 14/30] Removed tests folder because it was not needed --- tests/check_info_test.py | 13 ---------- tests/discover_plugins_test.py | 44 ---------------------------------- tests/listen_test.py | 14 ----------- tests/load_plugin_test.py | 12 ---------- tests/speak_test.py | 13 ---------- 5 files changed, 96 deletions(-) delete mode 100644 tests/check_info_test.py delete mode 100644 tests/discover_plugins_test.py delete mode 100644 tests/listen_test.py delete mode 100644 tests/load_plugin_test.py delete mode 100644 tests/speak_test.py diff --git a/tests/check_info_test.py b/tests/check_info_test.py deleted file mode 100644 index 5411495..0000000 --- a/tests/check_info_test.py +++ /dev/null @@ -1,13 +0,0 @@ -import unittest -import os - -from akulai.akulai import AkulAI - -class CheckInfoTest(unittest.TestCase): - akulai = AkulAI() - def test_check_info(self): - self.akulai.check_info('test_root', 'test_file', '.py') - self.assertTrue(os.path.isfile('test_root/test_file/plugin.info')) - -if __name__ == '__main__': - unittest.main() diff --git a/tests/discover_plugins_test.py b/tests/discover_plugins_test.py deleted file mode 100644 index 7d63f7a..0000000 --- a/tests/discover_plugins_test.py +++ /dev/null @@ -1,44 +0,0 @@ -import unittest -import os -from akulai.akulai import AkulAI - -class DiscoverPluginsTest(unittest.TestCase): - def test_discover_plugins(self): - akulai = AkulAI() - - # Test 1: Verify that the method discovers .py plugins - os.makedirs("plugins/test_py") - with open("plugins/test_py/test_py.py", "w") as f: - f.write("# Test .py plugin") - with open("plugins/test_py/plugin.info", "w") as f: - f.write("dependencies: numpy\nauthor: Test Author\ndescription: Test .py plugin") - akulai.discover_plugins() - self.assertIn("test_py", akulai.plugins) - self.assertEqual(".py", akulai.plugins["test_py"]["extension"]) - os.rmdir("plugins/test_py") - - # Test 2: Verify that the method discovers .js plugins - os.makedirs("plugins/test_js") - with open("plugins/test_js/test_js.js", "w") as f: - f.write("// Test .js plugin") - with open("plugins/test_js/plugin.info", "w") as f: - f.write("dependencies: express\nauthor: Test Author\ndescription: Test .js plugin") - akulai.discover_plugins() - self.assertIn("test_js", akulai.plugins) - self.assertEqual(".js", akulai.plugins["test_js"]["extension"]) - os.rmdir("plugins/test_js") - - # Test 3: Verify that the method discovers .pl plugins - os.makedirs("plugins/test_pl") - with open("plugins/test_pl/test_pl.pl", "w") as f: - f.write("# Test .pl plugin") - with open("plugins/test_pl/plugin.info", "w") as f: - f.write("dependencies: DBI\nauthor: Test Author\ndescription: Test .pl plugin") - akulai.discover_plugins() - self.assertIn("test_pl", akulai.plugins) - self.assertEqual(".pl", akulai.plugins["test_pl"]["extension"]) - os.rmdir("plugins/test_pl") - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/listen_test.py b/tests/listen_test.py deleted file mode 100644 index c56388a..0000000 --- a/tests/listen_test.py +++ /dev/null @@ -1,14 +0,0 @@ -import unittest - -from akulai.akulai import AkulAI - -class ListenTest(unittest.TestCase): - akulai = AkulAI() - - def test_listen(self): - self.assertTrue(self.akulai.listening_thread.is_alive()) - self.akulai.stop_listening.set() - self.akulai.listening_thread.join() - -if __name__ == '__main__': - unittest.main() \ No newline at end of file diff --git a/tests/load_plugin_test.py b/tests/load_plugin_test.py deleted file mode 100644 index 8562859..0000000 --- a/tests/load_plugin_test.py +++ /dev/null @@ -1,12 +0,0 @@ -import unittest -import os - -from akulai.akulai import AkulAI -class LoadPluginTest(unittest.TestCase): - akulai = AkulAI() - def test_check_info(self): - self.akulai.check_info('test_root', 'test_file', '.py') - self.assertTrue(os.path.isfile('test_root/test_file/plugin.info')) - -if __name__ == '__main__': - unittest.main() diff --git a/tests/speak_test.py b/tests/speak_test.py deleted file mode 100644 index 2be2e9f..0000000 --- a/tests/speak_test.py +++ /dev/null @@ -1,13 +0,0 @@ -import unittest - -from akulai.akulai import AkulAI -class SpeakTest(unittest.TestCase): - akulai = AkulAI() - - def test_speak(self): - self.assertTrue(self.akulai.speaking_thread.is_alive()) - self.akulai.stop_speaking.set() - self.akulai.speaking_thread.join() - -if __name__ == '__main__': - unittest.main() \ No newline at end of file From 53843ec01340e181d3aeaa9d53325a2865225c65 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Sun, 30 Jul 2023 12:32:34 -0400 Subject: [PATCH 15/30] Add all default plugins to core repository and remove the plugin downloading from the scripts --- plugins/calendar/main.js | 26 +++++++++++++++++++++++ plugins/calendar/plugin.info | 3 +++ plugins/stock_prices/main.pl | 36 ++++++++++++++++++++++++++++++++ plugins/stock_prices/plugin.info | 3 +++ plugins/time_date/main.py | 12 +++++++++++ plugins/time_date/plugin.info | 3 +++ plugins/weather/main.pl | 11 ++++++++++ plugins/weather/plugin.info | 3 +++ setup/setup.bat | 6 ------ setup/setup.py | 15 ------------- setup/setup.sh | 6 ------ 11 files changed, 97 insertions(+), 27 deletions(-) create mode 100644 plugins/calendar/main.js create mode 100644 plugins/calendar/plugin.info create mode 100644 plugins/stock_prices/main.pl create mode 100644 plugins/stock_prices/plugin.info create mode 100644 plugins/time_date/main.py create mode 100644 plugins/time_date/plugin.info create mode 100644 plugins/weather/main.pl create mode 100644 plugins/weather/plugin.info diff --git a/plugins/calendar/main.js b/plugins/calendar/main.js new file mode 100644 index 0000000..f7078a1 --- /dev/null +++ b/plugins/calendar/main.js @@ -0,0 +1,26 @@ +const fs = require("fs"); +const events = []; + +const addEvent = (event, date) => { + events.push({event, date}); + fs.writeFileSync("events.json", JSON.stringify(events)); + console.log("Event added: " + event); +}; + +const checkEvents = () => { + setInterval(() => { + const now = new Date(); + events.forEach((event) => { + const eventDate = new Date(event.date); + if (now.getTime() >= eventDate.getTime()) { + console.log("Reminder: " + event.event); + akulAI.speak("Reminder: " + event.event); + } + }); + }, 60000); +}; + +module.exports = { + addEvent, + checkEvents +}; diff --git a/plugins/calendar/plugin.info b/plugins/calendar/plugin.info new file mode 100644 index 0000000..48b9af3 --- /dev/null +++ b/plugins/calendar/plugin.info @@ -0,0 +1,3 @@ +author: Akul Goel +dependencies: fs +description: This plugin asks for events and stores them in a JSON database. When the time comes, it will remind you to do your saved event. diff --git a/plugins/stock_prices/main.pl b/plugins/stock_prices/main.pl new file mode 100644 index 0000000..7e8c815 --- /dev/null +++ b/plugins/stock_prices/main.pl @@ -0,0 +1,36 @@ +#!/usr/bin/perl + +use LWP::UserAgent; + +sub fetch_stock_price { + my $ticker = shift; + + # Get stock information from Google Finance + my $url = "https://www.google.com/finance?q=$ticker"; + my $ua = LWP::UserAgent->new; + my $response = $ua->get($url); + + # Check if request was successful + if ($response->is_success) { + my $html = $response->decoded_content; + + # Extract the stock price + if ($html =~ /ref_.*_l">(.*?)<\/span>/i) { + return "The current stock price for $ticker is $1."; + } else { + return "Unable to find stock price for $ticker."; + } + } else { + return "Error fetching stock price for $ticker: " . $response->status_line; + } +} + +sub handle { + my $command = shift; + if ($command =~ /stock price for (.*)/i) { + return fetch_stock_price($1); + } + return "Invalid command."; +} + +1; diff --git a/plugins/stock_prices/plugin.info b/plugins/stock_prices/plugin.info new file mode 100644 index 0000000..3c1df57 --- /dev/null +++ b/plugins/stock_prices/plugin.info @@ -0,0 +1,3 @@ +author: Akul Goel +dependencies: LWP::UserAgent +description: This plugin tells you the stock prices when you ask it to. diff --git a/plugins/time_date/main.py b/plugins/time_date/main.py new file mode 100644 index 0000000..c6c5382 --- /dev/null +++ b/plugins/time_date/main.py @@ -0,0 +1,12 @@ +import datetime + +# define all commonly used variables here +now = datetime.datetime.now() + +def handle(command): + if "time" in command: + time_now = now.strftime("%H:%M:%S") + akulai.speak(f"The current time is{time_now}") + if "date" in command: + date_now = now.strftime("%Y-%m-%d") + akulai.speak(f"The current date is{date_now}") diff --git a/plugins/time_date/plugin.info b/plugins/time_date/plugin.info new file mode 100644 index 0000000..70ec124 --- /dev/null +++ b/plugins/time_date/plugin.info @@ -0,0 +1,3 @@ +author: Akul Goel +dependencies: datetime +description: This plugin tells you the time/date when you ask it to. diff --git a/plugins/weather/main.pl b/plugins/weather/main.pl new file mode 100644 index 0000000..ac22b98 --- /dev/null +++ b/plugins/weather/main.pl @@ -0,0 +1,11 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use Weather::Google; + +my $location = shift; + +my $weather = Weather::Google->new($location); + +print "The weather in $location is currently " . $weather->condition->temp . "F and " . $weather->condition->text . "\n"; diff --git a/plugins/weather/plugin.info b/plugins/weather/plugin.info new file mode 100644 index 0000000..69134d8 --- /dev/null +++ b/plugins/weather/plugin.info @@ -0,0 +1,3 @@ +author: Akul Goel +dependencies: Weather::Google +description: This plugin checks Google for the weather around you. diff --git a/setup/setup.bat b/setup/setup.bat index 94554af..8cd81c4 100644 --- a/setup/setup.bat +++ b/setup/setup.bat @@ -1,12 +1,6 @@ @echo off cd ".." -SET repo_url=https://github.com/Akul-AI/akulai-plugins -SET subdir=plugins -git "submodule" "add" "%repo_url%" -git "submodule" "update" "--init" "--recursive" -mv "akulai-plugins/%subdir%" "akulai/" -DEL /S "akulai-plugins" SET vosk_url=https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip curl "-o" "vosk-model-small-en-us-0.15.zip" "%vosk_url%" unzip "vosk-model-small-en-us-0.15.zip" "-d" "akulai" diff --git a/setup/setup.py b/setup/setup.py index 708b15f..123d150 100644 --- a/setup/setup.py +++ b/setup/setup.py @@ -1,6 +1,5 @@ # If using this script on Windows, just keep in mind that this script needs to be run with administrator permissions. import os -import shutil import zipfile import requests import platform @@ -8,20 +7,6 @@ # Change directory to the parent directory of the script os.chdir("..") -# Define the GitHub repository URL and subdirectory -repo_url = "https://github.com/Akul-AI/akulai-plugins" -subdir = "plugins" - -# Use git submodules to fetch the plugins subdir in the akulai plugins repo -os.system("git submodule add {} --name akulai-plugins".format(repo_url)) -os.system("git submodule update --init --recursive") - -# Move the files from the subdirectory to the local "akulai/plugins" folder -shutil.move("{}/".format(f"akulai-plugins/{subdir}"), "akulai/") - -# Delete the files after copying them -shutil.rmtree("akulai-plugins") - # Use requests library to download vosk vosk_url = "https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip" response = requests.get(vosk_url) diff --git a/setup/setup.sh b/setup/setup.sh index 418cf22..f4fae26 100644 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -1,12 +1,6 @@ #!/bin/bash cd .. -repo_url="https://github.com/Akul-AI/akulai-plugins" -subdir="plugins" -git submodule add $repo_url -git submodule update --init --recursive -mv "akulai-plugins/$subdir" "akulai/" -rm -r "akulai-plugins" vosk_url="https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip" curl -o "vosk-model-small-en-us-0.15.zip" $vosk_url unzip "vosk-model-small-en-us-0.15.zip" -d "akulai" From a6e6077ac69f89d37cfd5f46a27405d89026f400 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Sun, 30 Jul 2023 18:25:45 -0400 Subject: [PATCH 16/30] Start fixinng plugins and getting server running --- akulai/akulai.py | 14 +++++++------ docs/create_plugins.md | 4 ++-- plugins/calendar/main.js | 4 +++- plugins/stock_prices/main.pl | 36 -------------------------------- plugins/stock_prices/plugin.info | 3 --- plugins/time_date/main.py | 8 +++++-- 6 files changed, 19 insertions(+), 50 deletions(-) delete mode 100644 plugins/stock_prices/main.pl delete mode 100644 plugins/stock_prices/plugin.info diff --git a/akulai/akulai.py b/akulai/akulai.py index 150a669..48767eb 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -10,7 +10,7 @@ import vosk import sys from fastapi import FastAPI -import webbrowser +import time class JSPlugin: @@ -132,12 +132,17 @@ def stop(self): akulai = AkulAI() if __name__ == '__main__': + + # Run API server + os.system("uvicorn akulai:app --reload") + time.sleep(5) + # Create the listening thread akulai.stop_listening = threading.Event() akulai.listening_thread = threading.Thread(target=akulai.listen) akulai.listening_thread.start() - @app.get("/speak/{text}") + @app.post("/speak/{text}") async def speak(text: str): akulai.speak(text) return {"message": "Text synthesized"} @@ -146,8 +151,5 @@ async def speak(text: str): async def listen(): akulai.listen() return {"message": "Listening..."} - - # Run the server for the API - os.system("uvicorn akulai:app --reload") - webbrowser.open("http://127.0.0.1:8000") + akulai.speak("Hello, I am AkulAI. How can I help you today?") diff --git a/docs/create_plugins.md b/docs/create_plugins.md index da16bc2..9777b8a 100644 --- a/docs/create_plugins.md +++ b/docs/create_plugins.md @@ -12,7 +12,7 @@ Next, create a file in your sub-directory called `plugin.info`. It should look s ``` author: John Doe dependencies: requests, pandas -description: Lorem ipsum di olor nulla quis lorem ut libero malesuada feugiat. This plugin.info file is an example. See the akulai_plugins repository for more examples. +description: Lorem ipsum di olor nulla quis lorem ut libero malesuada feugiat. This plugin.info file is an example. ``` The dependencies may vary based on your project. Note that when listing the dependencies, list them by the name you installed them. For example, if you installed a dependency with `pip install py-example`(note that this is an example, and applies to all languages), but imported it with `import example`, you would still list the dependency `as py-example`. If you have no dependencies required to be installed, just leave it blank. @@ -30,7 +30,7 @@ import requests response = requests.get('http://127.0.0.1:8000/speak') def handle(command): if "hello" in command: - speak("Hello there!") + response.speak("Hello there!") ``` ## Javascript Plugins JavaScript plugins should read from the commandline and write to stdout using console.log(). diff --git a/plugins/calendar/main.js b/plugins/calendar/main.js index f7078a1..586d19f 100644 --- a/plugins/calendar/main.js +++ b/plugins/calendar/main.js @@ -1,6 +1,8 @@ const fs = require("fs"); const events = []; +fetch('http://127.0.0.1:8000/speak') + const addEvent = (event, date) => { events.push({event, date}); fs.writeFileSync("events.json", JSON.stringify(events)); @@ -14,7 +16,7 @@ const checkEvents = () => { const eventDate = new Date(event.date); if (now.getTime() >= eventDate.getTime()) { console.log("Reminder: " + event.event); - akulAI.speak("Reminder: " + event.event); + speak("Reminder: " + event.event); } }); }, 60000); diff --git a/plugins/stock_prices/main.pl b/plugins/stock_prices/main.pl deleted file mode 100644 index 7e8c815..0000000 --- a/plugins/stock_prices/main.pl +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/perl - -use LWP::UserAgent; - -sub fetch_stock_price { - my $ticker = shift; - - # Get stock information from Google Finance - my $url = "https://www.google.com/finance?q=$ticker"; - my $ua = LWP::UserAgent->new; - my $response = $ua->get($url); - - # Check if request was successful - if ($response->is_success) { - my $html = $response->decoded_content; - - # Extract the stock price - if ($html =~ /ref_.*_l">(.*?)<\/span>/i) { - return "The current stock price for $ticker is $1."; - } else { - return "Unable to find stock price for $ticker."; - } - } else { - return "Error fetching stock price for $ticker: " . $response->status_line; - } -} - -sub handle { - my $command = shift; - if ($command =~ /stock price for (.*)/i) { - return fetch_stock_price($1); - } - return "Invalid command."; -} - -1; diff --git a/plugins/stock_prices/plugin.info b/plugins/stock_prices/plugin.info deleted file mode 100644 index 3c1df57..0000000 --- a/plugins/stock_prices/plugin.info +++ /dev/null @@ -1,3 +0,0 @@ -author: Akul Goel -dependencies: LWP::UserAgent -description: This plugin tells you the stock prices when you ask it to. diff --git a/plugins/time_date/main.py b/plugins/time_date/main.py index c6c5382..ca08fd8 100644 --- a/plugins/time_date/main.py +++ b/plugins/time_date/main.py @@ -1,12 +1,16 @@ +import requests import datetime # define all commonly used variables here now = datetime.datetime.now() +response = requests.get('http://127.0.0.1:8000/speak') def handle(command): + if "time" in command: time_now = now.strftime("%H:%M:%S") - akulai.speak(f"The current time is{time_now}") + speak(f"The current time is{time_now}") + if "date" in command: date_now = now.strftime("%Y-%m-%d") - akulai.speak(f"The current date is{date_now}") + speak(f"The current date is{date_now}") \ No newline at end of file From 985b10ca78adc38c5f6ea46a895d3bd62b28c4f5 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Wed, 2 Aug 2023 21:36:49 -0400 Subject: [PATCH 17/30] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ec6daa6..97cee85 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,5 @@ You can look at the `todo.md` file (not always updated) or you can look at the i ## Other Information Version system - semantic versioning + Compatible with - Windows, Linux, Raspberry Pi From 32370247bce35a871af43035f4283ec47ef77c35 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Mon, 7 Aug 2023 10:37:41 -0400 Subject: [PATCH 18/30] Update .gitignore --- .gitignore | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitignore b/.gitignore index bd4f41b..69d9250 100644 --- a/.gitignore +++ b/.gitignore @@ -177,3 +177,19 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +# VOSK Model Files +model/vosk_model/am/final.mdl +model/vosk_model/conf/mfcc.conf +model/vosk_model/conf/model.conf +model/vosk_model/graph/disambig_tid.int +model/vosk_model/graph/Gr.fst +model/vosk_model/graph/HCLr.fst +model/vosk_model/graph/phones/word_boundary.int +model/vosk_model/ivector/final.dubm +model/vosk_model/ivector/final.ie +model/vosk_model/ivector/final.mat +model/vosk_model/ivector/global_cmvn.stats +model/vosk_model/ivector/online_cmvn.conf +model/vosk_model/ivector/splice.conf +model/vosk_model/README From 3b20912cd09593d2e1d59d4892b91004702e5af0 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Mon, 7 Aug 2023 10:39:06 -0400 Subject: [PATCH 19/30] Ignore all vosk model files for testing --- .gitignore | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 69d9250..e52a5f9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,22 @@ .gitmodules akulai/akulai-plugins -# Ignore the VOSK model folder +# Ignore the VOSK model folder and everything in it akulai/model +model/vosk_model/am/final.mdl +model/vosk_model/conf/mfcc.conf +model/vosk_model/conf/model.conf +model/vosk_model/graph/disambig_tid.int +model/vosk_model/graph/Gr.fst +model/vosk_model/graph/HCLr.fst +model/vosk_model/graph/phones/word_boundary.int +model/vosk_model/ivector/final.dubm +model/vosk_model/ivector/final.ie +model/vosk_model/ivector/final.mat +model/vosk_model/ivector/global_cmvn.stats +model/vosk_model/ivector/online_cmvn.conf +model/vosk_model/ivector/splice.conf +model/vosk_model/README # Ignore the plugins directory akulai/plugins @@ -177,19 +191,3 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ - -# VOSK Model Files -model/vosk_model/am/final.mdl -model/vosk_model/conf/mfcc.conf -model/vosk_model/conf/model.conf -model/vosk_model/graph/disambig_tid.int -model/vosk_model/graph/Gr.fst -model/vosk_model/graph/HCLr.fst -model/vosk_model/graph/phones/word_boundary.int -model/vosk_model/ivector/final.dubm -model/vosk_model/ivector/final.ie -model/vosk_model/ivector/final.mat -model/vosk_model/ivector/global_cmvn.stats -model/vosk_model/ivector/online_cmvn.conf -model/vosk_model/ivector/splice.conf -model/vosk_model/README From 2dfb2d3d128875dc9c882bf9bac3fd4dfb315332 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Sun, 13 Aug 2023 21:42:53 -0400 Subject: [PATCH 20/30] Shift API setup into the if condition at the end --- .gitignore | 4 ---- akulai/akulai.py | 14 +++++++------- plugins/calendar/main.js | 28 ---------------------------- plugins/calendar/plugin.info | 3 --- plugins/time_date/main.py | 16 ---------------- plugins/time_date/plugin.info | 3 --- plugins/weather/main.pl | 11 ----------- plugins/weather/plugin.info | 3 --- requirements.txt | 3 +-- 9 files changed, 8 insertions(+), 77 deletions(-) delete mode 100644 plugins/calendar/main.js delete mode 100644 plugins/calendar/plugin.info delete mode 100644 plugins/time_date/main.py delete mode 100644 plugins/time_date/plugin.info delete mode 100644 plugins/weather/main.pl delete mode 100644 plugins/weather/plugin.info diff --git a/.gitignore b/.gitignore index e52a5f9..dbd3d0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Files from setup .gitmodules -akulai/akulai-plugins # Ignore the VOSK model folder and everything in it akulai/model @@ -19,9 +18,6 @@ model/vosk_model/ivector/online_cmvn.conf model/vosk_model/ivector/splice.conf model/vosk_model/README -# Ignore the plugins directory -akulai/plugins - # IDE files and folders ./idea ./vscode diff --git a/akulai/akulai.py b/akulai/akulai.py index 48767eb..1fa7d9a 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -3,7 +3,7 @@ import importlib.util import json import os -import pyttsx3 +import rlvoice import pyaudio import subprocess import threading @@ -36,8 +36,8 @@ def __init__(self): # Initialize the pyaudio device self.p = pyaudio.PyAudio() self.stream = self.p.open(format=pyaudio.paInt16, channels=1, rate=16000, input=True, frames_per_buffer=8000) - # Initialize the pyttsx3 speech engine - self.engine = pyttsx3.init() + # Initialize the rlvoice speech engine + self.engine = rlvoice.init() self.voices = self.engine.getProperty('voices') self.engine.setProperty('voice', self.voices[0].id) # load the plugins @@ -127,12 +127,12 @@ def stop(self): self.p.terminate() sys.exit() -# Set up API -app = FastAPI() -akulai = AkulAI() - if __name__ == '__main__': + # Set up API + app = FastAPI() + akulai = AkulAI() + # Run API server os.system("uvicorn akulai:app --reload") time.sleep(5) diff --git a/plugins/calendar/main.js b/plugins/calendar/main.js deleted file mode 100644 index 586d19f..0000000 --- a/plugins/calendar/main.js +++ /dev/null @@ -1,28 +0,0 @@ -const fs = require("fs"); -const events = []; - -fetch('http://127.0.0.1:8000/speak') - -const addEvent = (event, date) => { - events.push({event, date}); - fs.writeFileSync("events.json", JSON.stringify(events)); - console.log("Event added: " + event); -}; - -const checkEvents = () => { - setInterval(() => { - const now = new Date(); - events.forEach((event) => { - const eventDate = new Date(event.date); - if (now.getTime() >= eventDate.getTime()) { - console.log("Reminder: " + event.event); - speak("Reminder: " + event.event); - } - }); - }, 60000); -}; - -module.exports = { - addEvent, - checkEvents -}; diff --git a/plugins/calendar/plugin.info b/plugins/calendar/plugin.info deleted file mode 100644 index 48b9af3..0000000 --- a/plugins/calendar/plugin.info +++ /dev/null @@ -1,3 +0,0 @@ -author: Akul Goel -dependencies: fs -description: This plugin asks for events and stores them in a JSON database. When the time comes, it will remind you to do your saved event. diff --git a/plugins/time_date/main.py b/plugins/time_date/main.py deleted file mode 100644 index ca08fd8..0000000 --- a/plugins/time_date/main.py +++ /dev/null @@ -1,16 +0,0 @@ -import requests -import datetime - -# define all commonly used variables here -now = datetime.datetime.now() - -response = requests.get('http://127.0.0.1:8000/speak') -def handle(command): - - if "time" in command: - time_now = now.strftime("%H:%M:%S") - speak(f"The current time is{time_now}") - - if "date" in command: - date_now = now.strftime("%Y-%m-%d") - speak(f"The current date is{date_now}") \ No newline at end of file diff --git a/plugins/time_date/plugin.info b/plugins/time_date/plugin.info deleted file mode 100644 index 70ec124..0000000 --- a/plugins/time_date/plugin.info +++ /dev/null @@ -1,3 +0,0 @@ -author: Akul Goel -dependencies: datetime -description: This plugin tells you the time/date when you ask it to. diff --git a/plugins/weather/main.pl b/plugins/weather/main.pl deleted file mode 100644 index ac22b98..0000000 --- a/plugins/weather/main.pl +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use Weather::Google; - -my $location = shift; - -my $weather = Weather::Google->new($location); - -print "The weather in $location is currently " . $weather->condition->temp . "F and " . $weather->condition->text . "\n"; diff --git a/plugins/weather/plugin.info b/plugins/weather/plugin.info deleted file mode 100644 index 69134d8..0000000 --- a/plugins/weather/plugin.info +++ /dev/null @@ -1,3 +0,0 @@ -author: Akul Goel -dependencies: Weather::Google -description: This plugin checks Google for the weather around you. diff --git a/requirements.txt b/requirements.txt index ccee342..8812b95 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,8 @@ pypi-json -pyttsx3 +rlvoice-1 vosk pyaudio js2py -json fastapi[all] requests # Must use Python 3.10 or above, optional, only for refining code From b9385a3514db05bcd5a55fe50e617b1701db4dc1 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Sun, 13 Aug 2023 21:43:50 -0400 Subject: [PATCH 21/30] Add plugin files --- plugins/calendar/main.js | 28 ++++++++++++++++++++++++++++ plugins/calendar/plugin.info | 3 +++ plugins/time_date/main.py | 16 ++++++++++++++++ plugins/time_date/plugin.info | 3 +++ plugins/weather/main.pl | 11 +++++++++++ plugins/weather/plugin.info | 3 +++ 6 files changed, 64 insertions(+) create mode 100644 plugins/calendar/main.js create mode 100644 plugins/calendar/plugin.info create mode 100644 plugins/time_date/main.py create mode 100644 plugins/time_date/plugin.info create mode 100644 plugins/weather/main.pl create mode 100644 plugins/weather/plugin.info diff --git a/plugins/calendar/main.js b/plugins/calendar/main.js new file mode 100644 index 0000000..586d19f --- /dev/null +++ b/plugins/calendar/main.js @@ -0,0 +1,28 @@ +const fs = require("fs"); +const events = []; + +fetch('http://127.0.0.1:8000/speak') + +const addEvent = (event, date) => { + events.push({event, date}); + fs.writeFileSync("events.json", JSON.stringify(events)); + console.log("Event added: " + event); +}; + +const checkEvents = () => { + setInterval(() => { + const now = new Date(); + events.forEach((event) => { + const eventDate = new Date(event.date); + if (now.getTime() >= eventDate.getTime()) { + console.log("Reminder: " + event.event); + speak("Reminder: " + event.event); + } + }); + }, 60000); +}; + +module.exports = { + addEvent, + checkEvents +}; diff --git a/plugins/calendar/plugin.info b/plugins/calendar/plugin.info new file mode 100644 index 0000000..48b9af3 --- /dev/null +++ b/plugins/calendar/plugin.info @@ -0,0 +1,3 @@ +author: Akul Goel +dependencies: fs +description: This plugin asks for events and stores them in a JSON database. When the time comes, it will remind you to do your saved event. diff --git a/plugins/time_date/main.py b/plugins/time_date/main.py new file mode 100644 index 0000000..ca08fd8 --- /dev/null +++ b/plugins/time_date/main.py @@ -0,0 +1,16 @@ +import requests +import datetime + +# define all commonly used variables here +now = datetime.datetime.now() + +response = requests.get('http://127.0.0.1:8000/speak') +def handle(command): + + if "time" in command: + time_now = now.strftime("%H:%M:%S") + speak(f"The current time is{time_now}") + + if "date" in command: + date_now = now.strftime("%Y-%m-%d") + speak(f"The current date is{date_now}") \ No newline at end of file diff --git a/plugins/time_date/plugin.info b/plugins/time_date/plugin.info new file mode 100644 index 0000000..70ec124 --- /dev/null +++ b/plugins/time_date/plugin.info @@ -0,0 +1,3 @@ +author: Akul Goel +dependencies: datetime +description: This plugin tells you the time/date when you ask it to. diff --git a/plugins/weather/main.pl b/plugins/weather/main.pl new file mode 100644 index 0000000..ac22b98 --- /dev/null +++ b/plugins/weather/main.pl @@ -0,0 +1,11 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use Weather::Google; + +my $location = shift; + +my $weather = Weather::Google->new($location); + +print "The weather in $location is currently " . $weather->condition->temp . "F and " . $weather->condition->text . "\n"; diff --git a/plugins/weather/plugin.info b/plugins/weather/plugin.info new file mode 100644 index 0000000..69134d8 --- /dev/null +++ b/plugins/weather/plugin.info @@ -0,0 +1,3 @@ +author: Akul Goel +dependencies: Weather::Google +description: This plugin checks Google for the weather around you. From f5e1c12a2fa8f335cee2fc6e8febbecef888d1a2 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Mon, 14 Aug 2023 10:35:45 -0400 Subject: [PATCH 22/30] Fix VOSK model not being able to read the model files --- .gitignore | 16 +--------------- setup/setup.bat | 2 ++ setup/setup.py | 6 +++++- setup/setup.sh | 2 ++ 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index dbd3d0d..857b5c6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,21 +2,7 @@ .gitmodules # Ignore the VOSK model folder and everything in it -akulai/model -model/vosk_model/am/final.mdl -model/vosk_model/conf/mfcc.conf -model/vosk_model/conf/model.conf -model/vosk_model/graph/disambig_tid.int -model/vosk_model/graph/Gr.fst -model/vosk_model/graph/HCLr.fst -model/vosk_model/graph/phones/word_boundary.int -model/vosk_model/ivector/final.dubm -model/vosk_model/ivector/final.ie -model/vosk_model/ivector/final.mat -model/vosk_model/ivector/global_cmvn.stats -model/vosk_model/ivector/online_cmvn.conf -model/vosk_model/ivector/splice.conf -model/vosk_model/README +akulai/model/vosk_model # IDE files and folders ./idea diff --git a/setup/setup.bat b/setup/setup.bat index 8cd81c4..e224366 100644 --- a/setup/setup.bat +++ b/setup/setup.bat @@ -1,11 +1,13 @@ @echo off cd ".." +cd "akulai" SET vosk_url=https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip curl "-o" "vosk-model-small-en-us-0.15.zip" "%vosk_url%" unzip "vosk-model-small-en-us-0.15.zip" "-d" "akulai" mv "akulai\models\vosk-model-small-en-us-0.15" "akulai\models\vosk_model" DEL "vosk-model-small-en-us-0.15.zip" +cd ".." sudo "apt-get" "update" sudo "apt-get" "install" "-y" "nodejs" wget "http://strawberryperl.com/download/5.32.0.1/strawberry-perl-5.32.0.1-64bit.tar.bz2" diff --git a/setup/setup.py b/setup/setup.py index 123d150..2899eb1 100644 --- a/setup/setup.py +++ b/setup/setup.py @@ -4,8 +4,9 @@ import requests import platform -# Change directory to the parent directory of the script +# Change directory to the akulai directory os.chdir("..") +os.chdir("akulai") # Use requests library to download vosk vosk_url = "https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip" @@ -23,6 +24,9 @@ # Clean up the downloaded archive os.remove("vosk-model-small-en-us-0.15.zip") +# Change directory to the base directory +os.chdir("..") + # Check the current operating system current_os = platform.system() diff --git a/setup/setup.sh b/setup/setup.sh index f4fae26..4b6b1be 100644 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -1,11 +1,13 @@ #!/bin/bash cd .. +cd akulai vosk_url="https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip" curl -o "vosk-model-small-en-us-0.15.zip" $vosk_url unzip "vosk-model-small-en-us-0.15.zip" -d "akulai" mv "akulai/model/vosk-model-small-en-us-0.15" "akulai/model/vosk_model" rm "vosk-model-small-en-us-0.15.zip" +cd .. sudo apt-get update sudo apt-get install -y nodejs pip install -r requirements.txt From ed769fe8b1a95c500f727f44302c576ce1e3d8bf Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Mon, 14 Aug 2023 12:31:29 -0400 Subject: [PATCH 23/30] Update `.idea` folder for anaconda distribution --- .idea/akulai.iml | 6 ++++-- .idea/misc.xml | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.idea/akulai.iml b/.idea/akulai.iml index 46d5c67..2284e7d 100644 --- a/.idea/akulai.iml +++ b/.idea/akulai.iml @@ -1,8 +1,10 @@ - - + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 350d8f3..a640abe 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,11 @@ - + + + \ No newline at end of file From 555c4b7575ec3f5414666ca5d3c3ff8574de5db6 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Thu, 17 Aug 2023 12:30:20 -0400 Subject: [PATCH 24/30] Remove packages we don't use --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8812b95..32a4d5b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,6 @@ pypi-json rlvoice-1 vosk pyaudio -js2py fastapi[all] requests # Must use Python 3.10 or above, optional, only for refining code From adf9b658ccbd5b7de1e500748b7bce853dcf8d6f Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Thu, 17 Aug 2023 13:18:13 -0400 Subject: [PATCH 25/30] Stop the `Error loading ASGI app. Attribute "app" not found in module "akulai". ` error For some reason, until a keyboard interrupt, the VOSK model and FastAPI keep initializing themselves. I haven't been able to test after that, however. --- akulai/akulai.py | 50 +++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/akulai/akulai.py b/akulai/akulai.py index 1fa7d9a..f7696f7 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -127,29 +127,27 @@ def stop(self): self.p.terminate() sys.exit() -if __name__ == '__main__': - - # Set up API - app = FastAPI() - akulai = AkulAI() - - # Run API server - os.system("uvicorn akulai:app --reload") - time.sleep(5) - - # Create the listening thread - akulai.stop_listening = threading.Event() - akulai.listening_thread = threading.Thread(target=akulai.listen) - akulai.listening_thread.start() - - @app.post("/speak/{text}") - async def speak(text: str): - akulai.speak(text) - return {"message": "Text synthesized"} - - @app.post("/listen") - async def listen(): - akulai.listen() - return {"message": "Listening..."} - - akulai.speak("Hello, I am AkulAI. How can I help you today?") +# Set up API +app = FastAPI() +akulAI = AkulAI() + +# Run API server +os.system("uvicorn akulai:app --reload") +time.sleep(5) + +# Create the listening thread +akulAI.stop_listening = threading.Event() +akulAI.listening_thread = threading.Thread(target=akulAI.listen) +akulAI.listening_thread.start() + +@app.post("/speak/{text}") +async def speak(text: str): + akulAI.speak(text) + return {"message": "Text synthesized"} + +@app.post("/listen") +async def listen(): + akulAI.listen() + return {"message": "Listening..."} + +akulAI.speak("Hello, I am AkulAI. How can I help you today?") From ea0cf960abd7cd6480091d6764158ae713dd7ff2 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Fri, 18 Aug 2023 14:35:34 -0400 Subject: [PATCH 26/30] Update akulai.py --- akulai/akulai.py | 1 + 1 file changed, 1 insertion(+) diff --git a/akulai/akulai.py b/akulai/akulai.py index f7696f7..cde7bbb 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -39,6 +39,7 @@ def __init__(self): # Initialize the rlvoice speech engine self.engine = rlvoice.init() self.voices = self.engine.getProperty('voices') + self.engine.setProperty('rate', 100) self.engine.setProperty('voice', self.voices[0].id) # load the plugins self.discover_plugins() From 983d19bcfb1b6042b76e3a0263fc7fb4d2de120f Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Sun, 8 Oct 2023 11:47:08 -0400 Subject: [PATCH 27/30] update js plugins --- .gitignore | 5 ++++- .vscode/settings.json | 3 +++ akulai/akulai.py | 2 +- docs/create_plugins.md | 34 ++++++++++++++++++++++++------ plugins/calendar/package-lock.json | 21 ++++++++++++++++++ plugins/calendar/package.json | 15 +++++++++++++ plugins/time_date/main.py | 6 +++--- 7 files changed, 74 insertions(+), 12 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 plugins/calendar/package-lock.json create mode 100644 plugins/calendar/package.json diff --git a/.gitignore b/.gitignore index 857b5c6..ce2b333 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ .gitmodules # Ignore the VOSK model folder and everything in it -akulai/model/vosk_model +model/vosk_model # IDE files and folders ./idea @@ -173,3 +173,6 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +# JS Plugin-related +node_modules/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..457f44d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.analysis.typeCheckingMode": "basic" +} \ No newline at end of file diff --git a/akulai/akulai.py b/akulai/akulai.py index cde7bbb..627ec9d 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -64,7 +64,7 @@ def discover_plugins(self): # Add the plugin to the list self.plugins.append(plugin) - print(f"Loaded plugin from {plugin_path}") + print(f"Loaded python plugin: {plugin_path}") elif filename.endswith(".pl"): # Load the Perl plugin using subprocess diff --git a/docs/create_plugins.md b/docs/create_plugins.md index 9777b8a..4239277 100644 --- a/docs/create_plugins.md +++ b/docs/create_plugins.md @@ -15,16 +15,16 @@ dependencies: requests, pandas description: Lorem ipsum di olor nulla quis lorem ut libero malesuada feugiat. This plugin.info file is an example. ``` -The dependencies may vary based on your project. Note that when listing the dependencies, list them by the name you installed them. For example, if you installed a dependency with `pip install py-example`(note that this is an example, and applies to all languages), but imported it with `import example`, you would still list the dependency `as py-example`. If you have no dependencies required to be installed, just leave it blank. +The dependencies may vary based on your project. Note that when listing the dependencies, list them by the name you installed them. For example, if you installed a dependency with `pip install py-example`(note that this is an example, and applies to all languages), but imported it with `import example`, you would still list the dependency `as py-example`. If you have no dependencies required to be installed, just leave it blank. Note that default packages (such as `os` in python, which comes preinstalled with python) should nnot be included. -Moreover, all plugins now require calling an API whihc gives them access to teh speak and listen function, allowing them to speak and listen when needed in the plugin. For using the speak function, it requires a GET request, and for listen, it requires a POST request. I have only included GET in this so far. If, for whatever reason, you do not require this, you may skip calling the API, and it will instead print in the console. +Moreover, all plugins now require calling an API which gives them access to the speak and listen function, allowing them to speak and listen when needed in the plugin. For using the speak function, it requires a GET request, and for listen, it requires a POST request. I have only included GET in this so far. If, for whatever reason, you do not require this, you may skip calling the API, and print in the console rather than using the `speak()` and `listen()` functions. ## Python Plugins Python plugins should be written as a function called `handle()` with one parameter, `command`, which is the text of what the user said. It should return the text of AkulAI would like to say to the user. Here is an example of a Python plugin that says "Hello, World!" when the user says "hello": -``` python +```python import requests response = requests.get('http://127.0.0.1:8000/speak') @@ -37,7 +37,7 @@ JavaScript plugins should read from the commandline and write to stdout using co Here is an example of a JavaScript plugin that says "Hello, World!" when the user says "hello": -``` javascript +```javascript fetch('http://127.0.0.1:8000/speak') command = "" @@ -61,7 +61,7 @@ if (command.includes("hello")){ ``` or you can use `RegExp` to check if a string matches a specific pattern, like this: -``` javascript +```javascript let match = command.match(/hello/); if (match) { console.log("Hello there!") @@ -69,7 +69,27 @@ if (match) { ``` It all depends on your plugin and preference. -Keep in mind that when making plugins which require packages, the `node_modules` directory and the `package.json` file belong in the root directory. +Keep in mind that when making plugins which require packages, the `node_modules` directory and the `package.json` file belong in the directory of the plugin. + +Here is an example of a `package.json` file for the inbuilt calendar skill: +```json +{ + "name": "calendar", + "version": "1.0.0", + "description": "", + "main": "main.js", + "scripts": { + "test": "npm run dev", + "start": "node main.js" + }, + "author": "Akul Goel", + "license": "ISC", + "dependencies": { + "fs": "^0.0.1-security" + } +} +``` +MAKE SURE YOU ONLY USE NPM, OTHER JS PACKAGE MANAGERS AREN'T CURRENTLY SUPPORTED. ## Perl Plugins @@ -87,7 +107,7 @@ if($command=~/hello/){ speak("Hello there!\n"); } ``` -Perl plugins should read from the commandline and write to stdout using print(). This example uses the command variable to check if the command contains the word "hello" and if true, print a response for AkulAI to read. +This example uses the command variable to check if the command contains the word "hello" and if true, speak a response for AkulAI to read. ## Using a Plugin Once a plugin has been created, it will automatically be loaded and available for use when the `AkulAI` class is instantiated. The `AkulAI` class will search for any files with the extensions of ".py" or ".js" in the "plugins" directory, and will add them to the list of available plugins. diff --git a/plugins/calendar/package-lock.json b/plugins/calendar/package-lock.json new file mode 100644 index 0000000..afbd927 --- /dev/null +++ b/plugins/calendar/package-lock.json @@ -0,0 +1,21 @@ +{ + "name": "calendar", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "calendar", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "fs": "^0.0.1-security" + } + }, + "node_modules/fs": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==" + } + } +} diff --git a/plugins/calendar/package.json b/plugins/calendar/package.json new file mode 100644 index 0000000..2976028 --- /dev/null +++ b/plugins/calendar/package.json @@ -0,0 +1,15 @@ +{ + "name": "calendar", + "version": "1.0.0", + "description": "", + "main": "main.js", + "scripts": { + "test": "npm run dev", + "start": "node main.js" + }, + "author": "Akul Goel", + "license": "ISC", + "dependencies": { + "fs": "^0.0.1-security" + } +} diff --git a/plugins/time_date/main.py b/plugins/time_date/main.py index ca08fd8..09a2519 100644 --- a/plugins/time_date/main.py +++ b/plugins/time_date/main.py @@ -8,9 +8,9 @@ def handle(command): if "time" in command: - time_now = now.strftime("%H:%M:%S") - speak(f"The current time is{time_now}") + time_now = now.strftime("%H:%M") # %H:%M:%S + speak(f"The current time is {time_now}") if "date" in command: date_now = now.strftime("%Y-%m-%d") - speak(f"The current date is{date_now}") \ No newline at end of file + speak(f"The current date is {date_now}") \ No newline at end of file From be4431e6f204cfb27342081f3adbe85f6bbf4c01 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Thu, 2 Nov 2023 18:13:52 -0400 Subject: [PATCH 28/30] Fixed all threading related errors, some other errors still remain --- akulai/akulai.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/akulai/akulai.py b/akulai/akulai.py index 627ec9d..d8911e9 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -41,6 +41,10 @@ def __init__(self): self.voices = self.engine.getProperty('voices') self.engine.setProperty('rate', 100) self.engine.setProperty('voice', self.voices[0].id) + # Create the listening thread + self.stop_listening = threading.Event() + self.listening_thread = threading.Thread(target=akulAI.listen) + self.listening_thread.start() # load the plugins self.discover_plugins() @@ -59,7 +63,7 @@ def discover_plugins(self): # Load the Python plugin using importlib plugin_path = os.path.join(dirpath, filename) spec = importlib.util.spec_from_file_location("plugin", plugin_path) - plugin = importlib.util.module_from_spec(spec) + plugin = importlib.util.module_from_spec(spec) # type: ignore spec.loader.exec_module(plugin) # Add the plugin to the list @@ -90,7 +94,7 @@ def discover_plugins(self): # Listen for audio input through mic with pyaudio and vosk def listen(self): - while not self.stop_listening.is_set(): + while not self.stop_listening.is_set(): # type: ignore data = self.stream.read(16000, exception_on_overflow=False) if len(data) == 0: break @@ -122,7 +126,7 @@ def execute_command(self, command): # shut down the program and all threads def stop(self): - self.stop_listening.set() + self.stop_listening.set() # type: ignore self.stream.stop_stream() self.stream.close() self.p.terminate() @@ -136,11 +140,6 @@ def stop(self): os.system("uvicorn akulai:app --reload") time.sleep(5) -# Create the listening thread -akulAI.stop_listening = threading.Event() -akulAI.listening_thread = threading.Thread(target=akulAI.listen) -akulAI.listening_thread.start() - @app.post("/speak/{text}") async def speak(text: str): akulAI.speak(text) From 8ea5e5eaa492cfb3a6d31ffd9ba7878dcecaa488 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Thu, 2 Nov 2023 18:18:56 -0400 Subject: [PATCH 29/30] Strawberry Perl docs in short for new users --- docs/strawberry-perl-docs.md | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 docs/strawberry-perl-docs.md diff --git a/docs/strawberry-perl-docs.md b/docs/strawberry-perl-docs.md new file mode 100644 index 0000000..8ce6df2 --- /dev/null +++ b/docs/strawberry-perl-docs.md @@ -0,0 +1,50 @@ +=== Strawberry Perl (64-bit) 5.38.0.1-64bit README === + +What is Strawberry Perl? +------------------------ + +* 'Perl' is a programming language suitable for writing simple scripts as well + as complex applications. See https://perldoc.perl.org/perlintro.html + +* 'Strawberry Perl' is a perl environment for Microsoft Windows containing all + you need to run and develop perl applications. It is designed to be as close + as possible to perl environment on UNIX systems. See https://strawberryperl.com/ + +* If you are completely new to perl consider visiting http2://learn.perl.org/ + +Installation instructions: (.ZIP distribution only, not .MSI installer) +----------------------------------------------------------------------- + +* If installing this version from a .zip file, you MUST extract it to a + directory that does not have spaces in it - e.g. c:\myperl\ + and then run some commands and manually set some environment variables: + + c:\myperl\relocation.pl.bat ... this is REQUIRED! + c:\myperl\update_env.pl.bat ... this is OPTIONAL + + You can specify " --nosystem" after update_env.pl.bat to install Strawberry + Perl's environment variables for the current user only. + +* If having a fixed installation path does not suit you, try "Strawberry Perl + Portable Edition" from https://strawberryperl.com/releases.html + +How to use Strawberry Perl? +--------------------------- + +* In the command prompt window you can: + + 1. run any perl script by launching + + c:\> perl c:\path\to\script.pl + + 2. install additional perl modules (libraries) from https://www.metacpan.org/ by + + c:\> cpanm Module::Name + + 3. run other tools included in Strawberry Perl like: perldoc, gcc, gmake ... + +* You'll need a text editor to create perl scripts. One is NOT included with + Strawberry Perl. A few options are Padre (which can be installed by running + "cpan Padre" from the command prompt) and Notepad++ (which is downloadable at + https://notepad-plus-plus.org/ ) which both include syntax highlighting + for perl scripts. You can even use Notepad, if you wish. From 1dbce12d76f3937cb724f2db7e2ea2a6eeee3d61 Mon Sep 17 00:00:00 2001 From: Akul Goel Date: Fri, 10 Nov 2023 11:45:41 -0500 Subject: [PATCH 30/30] No more Pylance errors, but plugins don't work --- akulai/akulai.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/akulai/akulai.py b/akulai/akulai.py index d8911e9..30cdcfc 100755 --- a/akulai/akulai.py +++ b/akulai/akulai.py @@ -39,11 +39,11 @@ def __init__(self): # Initialize the rlvoice speech engine self.engine = rlvoice.init() self.voices = self.engine.getProperty('voices') - self.engine.setProperty('rate', 100) + self.engine.setProperty('rate', 120) self.engine.setProperty('voice', self.voices[0].id) # Create the listening thread self.stop_listening = threading.Event() - self.listening_thread = threading.Thread(target=akulAI.listen) + self.listening_thread = threading.Thread(target=self.listen) self.listening_thread.start() # load the plugins self.discover_plugins() @@ -64,7 +64,7 @@ def discover_plugins(self): plugin_path = os.path.join(dirpath, filename) spec = importlib.util.spec_from_file_location("plugin", plugin_path) plugin = importlib.util.module_from_spec(spec) # type: ignore - spec.loader.exec_module(plugin) + spec.loader.exec_module(plugin) # type: ignore # Add the plugin to the list self.plugins.append(plugin) @@ -79,7 +79,7 @@ def discover_plugins(self): # Add the plugin to the list print(f"Loaded perl plugin: {plugin_path}") except subprocess.CalledProcessError: - print(f"Error loading perl plugin: {plugin_path}") + print(f"Error loading perl plugin: {plugin_path}") # type: ignore elif filename.endswith(".js"): # Load the JavaScript plugin using subprocess @@ -90,7 +90,7 @@ def discover_plugins(self): # Add the plugin to the list print(f"Loaded node plugin: {plugin_path}") except subprocess.CalledProcessError: - print(f"Error loading node plugin: {plugin_path}") + print(f"Error loading node plugin: {plugin_path}") # type: ignore # Listen for audio input through mic with pyaudio and vosk def listen(self):