A simple library for talking to ChatGPT from within Jupyter Notebook.
Motivation: Don’t fear ChatGPT taking your job. Fear a person using ChatGPT taking your job.
Of course, this is a sensationalized statement. But it very succinctly gets at something deep and important – using LLMs in your work can unlock massive productivity gains. I do not know of a better way for me to start using these tools than to bring them closer to where I work, which is Jupyter Notebooks.
Also, I really hate the “typewriter effect” where you are fed a few words at a time through the ChatGPT UI. I’d much rather have the full reply I can scan in a couple of seconds.
pip install git+https://github.com/radekosmulski/ask_ai.git
- Set the environment variable
OPENAI_API_KEY
to your OpenAI API key. - Load the magics in your jupyter notebook:
%load_ext ask_ai.magics
Use %%ai_ask
to start a new conversation, and %%ai_continue
to
continue an existing conversation.
%%ai_ask
starts a conversation with new (blank) context.
As long as you using %%ai_continue
all (or the most recent) previous
messages will be forwarded as context. This can be helpful if your
question is related to what you have been discussing so far. In other
cases, it is faster and cheaper to use %%ai_ask
as fewer tokens are
used.