RosettaTechnologies / AnkiBrain

147 stars 20 forks source link

Feat: Add Ollama Support #12

Open CPritch opened 3 months ago

CPritch commented 3 months ago

Hey there, here's a PR for adding Ollama to AnkiBrain. Had some fun during my time off to get this implemented. I think I've covered most of the bases here and didn't want to tinker too much with your current codebase or make any sweeping changes.

I suspect you'll want to change this PR to be merged into a new 0.7.4 branch. I'm not 100% clued in on your release process so I haven't touched anything like version numbers or change logs. Just MVP as far as I can tell.

I've added the following changes:

I believe it should handle the settings changes pretty gracefully but I'm not 100% on whether I've missed anything. I believe I've updated the python requirements correctly etc. I haven't been able to test all behaviour though as I don't use OpenAI.

Let me know if you have any issues or want me to change/address anything about this PR. Cool project though! Can see you've put a bunch of time into the codebase, I have a ton of suggestions for refactoring in general that I might be able to help with at some point soon. Just would help trim down the fat before adding any more functionality.

eshahrabani commented 2 months ago

Thanks for the massive pull request! It'll take me some time to get to reviewing this, but I plan to. I would like to upgrade dependencies where I can then integrate these changes. Ollama support will be great to have!

MazingerZetto commented 1 month ago

Hi @CPritch I downloaded your PR (from https://github.com/CPritch/AnkiBrain/tree/feat-ollama), and unzipped it inside the addons21 folder, however, after installing it, I get a "Your file couldn't be accessed" error in the GUI. Did that happen to you as well while developing / testing?

ashwathpalanisamy commented 2 weeks ago

Hi @CPritch I downloaded your PR (from https://github.com/CPritch/AnkiBrain/tree/feat-ollama), and unzipped it inside the addons21 folder, however, after installing it, I get a "Your file couldn't be accessed" error in the GUI. Did that happen to you as well while developing / testing?

Yeah, i am also getting the same error. @CPritch can you please help me resolve that error?