chuanqixu / anki-quick-ai Goto Github PK
View Code? Open in Web Editor NEWQuick interaction with OpenAI in Anki.
License: GNU Affero General Public License v3.0
Quick interaction with OpenAI in Anki.
License: GNU Affero General Public License v3.0
Error information:
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue to the add-on author.
Debug info:
Anki 23.10 (51a10f09) Python 3.9.15 Qt 6.5.3 PyQt 6.5.3
Platform: macOS-14.1.1-arm64-arm-64bit
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-11-08 13:40:58
Add-ons possibly involved: Anki Quick AI
Caught exception:
Traceback (most recent call last):
File "/Users/alanus/Library/Application Support/Anki2/addons21/547821970/controller.py", line 171, in run_add_on
run_dialog = RunDialog(parent)
File "/Users/alanus/Library/Application Support/Anki2/addons21/547821970/gui/run_dialog.py", line 15, in init
self.initUI()
File "/Users/alanus/Library/Application Support/Anki2/addons21/547821970/gui/run_dialog.py", line 65, in initUI
layout.addWidget(self.run_button, 0, Qt.AlignCenter) # align button to the center
AttributeError: type object 'Qt' has no attribute 'AlignCenter'
Hi there,
Thanks for taking the time to develop this!
I'd like to try it out, but after entering my OpenAI API Key via the add-on config, I can't seem to select a model - the add-on continually indicates "API key is not valid" and does not provide a dropdown to select a model. I've recreated the API key via https://platform.openai.com/api-keys, so I'm fairly confident I'm using a valid API key. Screenshot provided below::
In addition, trying to use the prompt interface yields the following error:
Anki 23.12.1 (1a1d4d54) (ao)
Python 3.9.15 Qt 6.6.1 PyQt 6.6.1
Platform: Windows-10-10.0.22621
Traceback (most recent call last):
File "C:\Users\qpmch\AppData\Roaming\Anki2\addons21\547821970\controller.py", line 66, in run
self.initial_response()
File "C:\Users\qpmch\AppData\Roaming\Anki2\addons21\547821970\controller.py", line 92, in initial_response
self.response(prompt)
File "C:\Users\qpmch\AppData\Roaming\Anki2\addons21\547821970\controller.py", line 76, in response
response = call_openai(self.model, prompt, self.system_prompt, **self.ai_config)
File "C:\Users\qpmch\AppData\Roaming\Anki2\addons21\547821970\ai.py", line 15, in call_openai
completion = openai.ChatCompletion.create(
File "C:\Users\qpmch\AppData\Roaming\Anki2\addons21\547821970\lib\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "C:\Users\qpmch\AppData\Roaming\Anki2\addons21\547821970\lib\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "C:\Users\qpmch\AppData\Roaming\Anki2\addons21\547821970\lib\openai\api_requestor.py", line 298, in request
resp, got_stream = self._interpret_response(result, stream)
File "C:\Users\qpmch\AppData\Roaming\Anki2\addons21\547821970\lib\openai\api_requestor.py", line 700, in _interpret_response
self._interpret_response_line(
File "C:\Users\qpmch\AppData\Roaming\Anki2\addons21\547821970\lib\openai\api_requestor.py", line 763, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: invalid model ID
===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
'' ['readwise-anki-gpt', 0, 'None', '']
Anki Quick AI ['547821970', 2023-11-29T22:37, 'None', mod]
===IDs of active AnkiWeb add-ons===
547821970
===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.