IntelliFiller ChatGPT addon

This is a support page for IntelliFiller ChatGPT addon. Submit bugs, share your ideas and prompts.

Editor button

This add-on allows you to autofill your cards using ChatGPT.


Pick a field from your card and use its name in your ChatGPT prompt, for example:

Explain grammar in the following Japanese sentence: {{{Sentence}}}

The result will be saved in a field of your choice, for example in the “Grammar Explanation” field.

You can use multiple fields, too, for example:

Is the word {{{Word}}} used in a literate or figurative sense in the following sentence? {{{Sentence}}}

Fill multiple cards
You can pick multiple cards and ask ChatGPT to fill their fields!

In the cards browser use Shift key to pick multiple cards. Then right click on them and pick the IntelliFiller menu. You will see the list of prompts.

Save your prompts

You can save the prompts you like and reuse them later.

Installation

Don’t forget to restart Anki after you installed the Add-on!

You will need to get ChatGPT API key, you will need to sign up in OpenAI and get it here.

Cost

Each request to ChatGPT API costs $0.002 , so you should not spend more than a couple of bucks on average-size deck. All money goes to ChatGPT, not me :sob:.

9 Likes

I was waiting for someone to make this addon! Thanks.

You used this as example:
“Explain grammar in the following Japanese sentence: {{{Sentence}}}”,
I think the result is better if you type: “Explain the usage of each word in this Japanese sentence: {{{Sentence}}}”

thanks for suggestion, I will check out the prompts that other people came up with. Some prompts give much better results, and I thought that maybe our users can share their favorite prompts somehow…

Have you tested it with anki 2.1.65?
I got this:
Error
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 2.1.65 (aa9a734f) Python 3.9.15 Qt 6.4.3 PyQt 6.4.0
Platform: Windows-10-10.0.22621
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2023-06-28 19:18:01

Caught exception:
Traceback (most recent call last):
File “C:\Users\nerib\AppData\Roaming\Anki2\addons21\1416178071_init_.py”, line 45, in
action.triggered.connect(lambda , p=prompt: create_run_prompt_dialog(editor.parentWindow, p))
File "C:\Users\nerib\AppData\Roaming\Anki2\addons21\1416178071_init
.py", line 17, in create_run_prompt_dialog
dialog = RunPromptDialog(browser, browser.selectedNotes(), prompt_config)
AttributeError: ‘EditCurrent’ object has no attribute ‘selectedNotes’


Edit: I understand now what happened,
If you use the addon from the “Edit card” window, this error pops up.
If you use the addon from the “Browse” window, it works normally.

oh, thanks for the investigation!
I am able to reproduce this bug, fixing it

I completely forgot that sometimes the Edit window is visible when the Browser is not available. The problem will also occur if you try to click on a ChatGPT button when you create a new card. I’m working on a patch. As a workaround, please use it from the Browser window, please

Please try to update the add-on my friend! Should work in every situation, even for the new cards and during the review!

Thanks for this, man. It’s a breakthrough!

Is there a limit to the amount of cards you can process in one batch? I’m on M1 2020 16GB and Anki crashes if I try to process a couple of hundreds at once.

Oh man… Let me try… actually, there should not be a problem, it’s just gonna be a long process. But hey, let me confirm.

Been getting crashes with much less than a hundred now. Perhaps it could be due to too much traffic.

If I may suggest one tweak: Due to this mysterious crash I’ve been spending a lot without getting the data in the end. It would be better to let the plugin save the response to the card as soon as it receives it from the server without waiting for the entire processing of other cards to end.

Love this idea. I’m wondering if you’ve looked into extending the addon to grade/review answers on type in the answer note types? Is it possible to send a typed answer to the gpt api with the question? If it is possible, could you retrieve the “graded” response from the api and show that to the user?

Yes, I managed to reproduce the bug and working on the solution. I also think that it would be wiser to save the note immediately after getting the answer. Stay tuned, the help is near!

I’m wondering if you’ve looked into extending the addon to grade/review answers on type in the answer note types?

Hmmm yeah sure it’s possible to do so, I guess… although I’m not sure than many people use anki for the free-form answers and need the grading on this… Could you explain how you will use it?

Sure, also just to be clear, I’m not suggesting that you build this, more something that I was curious about. The use case would be for verifying understanding of more complex ideas and definitely more towards a quantifying/grading progress use cases. Does that make sense?

Ops! Do I have to setup the billing to process this? Isn’t ChatGPT 3 default free?
Sorry for my ignorance if I am missing something obvious

ChatGPT (ie, the web app) is free but using the OpenAI API costs money.

My country cannot register an openai account.

you will need to set up their paid account and go to their API page to get your API key.

[Anki 23.10 beta 6] No module named ‘PyQt5’

The Qt5 compatibility code is now off by default, which may break some add-ons that haven’t been updated to support Qt6 in the last 2 years. If you find any have broken, please report the issues to the add-on author, and start Anki after setting the env var ENABLE_QT5_COMPAT to 1 to temporarily restore the compatibility code.

Fixes for the startup error, editor button, and settings window:
settings_editor.py

#from PyQt5.QtGui import QGuiApplication
try:
    from PyQt6.QtGui import QGuiApplication
except ImportError:
    from PyQt5.QtGui import QGuiApplication

prompt_ui.py AND settings_window_ui.py

#from PyQt5 import QtCore, QtGui, QtWidgets
try:
    from PyQt6 import QtCore, QtGui, QtWidgets
except ImportError:
    from PyQt5 import QtCore, QtGui, QtWidgets

        #SettingsWindow.setWindowModality(QtCore.Qt.NonModal)
        SettingsWindow.setWindowModality(QtCore.Qt.WindowModality.NonModal)
        #SettingsWindow.setWindowModality(QtCore.Qt.WindowType.NonModal)

replace every QtWidgets.QSizePolicy. with QtWidgets.QSizePolicy.Policy.

replace every Qt.Align with Qt.AlignmentFlag.Align

        #self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
        #self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)

        #self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint)
        self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SizeConstraint.SetNoConstraint)

process_notes.py

#from PyQt5.QtCore import QThread, pyqtSignal
#from PyQt5.QtWidgets import QDialog, QVBoxLayout, QProgressBar, QPushButton, QLabel
try:
    from PyQt6.QtCore import QThread, pyqtSignal
    from PyQt6.QtWidgets import QDialog, QVBoxLayout, QProgressBar, QPushButton, QLabel
except ImportError:
    from PyQt5.QtCore import QThread, pyqtSignal
    from PyQt5.QtWidgets import QDialog, QVBoxLayout, QProgressBar, QPushButton, QLabel

run_prompt_dialog.py

#from PyQt5.QtWidgets import QDialog, QVBoxLayout, QLabel, QPushButton, QTextEdit, QComboBox
try:
    from PyQt6.QtWidgets import QDialog, QVBoxLayout, QLabel, QPushButton, QTextEdit, QComboBox
except ImportError:
    from PyQt5.QtWidgets import QDialog, QVBoxLayout, QLabel, QPushButton, QTextEdit, QComboBox

1416178071\__init__.py

replace every .exec_( with .exec(

the editor button menu appears at the top-left of the button area

Thanks. Will try to make it compatible with beta Anki

i am from evil axis too,

but if you do want,

you will find the way.

not only openai API,
i did subscribe to chatgpt plus, and am using the android app with voice input!

ps: yes, i do not sure i can use next month, because those methods are not formal, and could be unstable, sometimes they are fake and only took away my money.