-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an API for plugins #14
base: master-v2
Are you sure you want to change the base?
Conversation
Hi @aaronchantrill, I have made some changes and would like you to review them as I am not as experienced with Perl/JS as I am with Python, so I'm not sure if I got anything wrong. Please try to doit as soon as possible so that I can update the plugins in the akulai-plugins repository when finished. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I understand what you are doing here, but I'm getting some errors.
I had to move the self... lines just after if __name__ == '__main__'
into the init method of the AkulAI() class. Now I'm getting "Error loading ASGI app. Attribute "app" not found in module "akulai". I have tried both running akulai.py
and running uvicorn akulai:app --reload
and got the same message either way. Do you have some special way you are running this?
I'm not familiar with FastAPI, so it will take me a little time to figure out, so please let me know if this makes sense to you.
Thanks!
Okay, I think I understand what the problem was. I had to move the api setup stuff above the if name == main but below the AkulAI() class definition. Then I changed it to use different paths for speak and listen:
At that point I was able to start the program and then navigate to |
I will add your proposed changes right now. I'm not sure how I would implement urldecode, however. |
I'm still having some issues with this. I'll try to submit a pull request. I'm trying to figure out why it won't shut down when I ask it to right now. Are you running this code on your system? |
Yes, I just pressed |
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.
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.)
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.
…loading from the scripts
There seems to be a problem where the plugins can't access the FastAPI server. I'm not sure what is causing this, any ideas? |
… "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.
Rather than calling through a server, I'm thinking we could just wrap the functions into a command line interface, through which the respective languages will have their own functions for. (for example, JS listen function will run a command in js to run the listen function) |
The previous PR, #12, was discontinued because I messed up somewhere and wasn't able to do anything about it. But, I have ported the same changes to this new version with less messy commits.
This basically gives all plugins access to the speak and listen functions when run, so they too can speak and listen when needed rather than printing output in CMD or listening once without follow-up questions.