Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: IPython-GPT, a Jupyter/IPython Interface to Chat GPT (github.com/santiagobasulto)
144 points by santiagobasulto on April 15, 2023 | hide | past | favorite | 29 comments




Thanks! I didn’t know about Jupytee. Before hacking ipython-gpt, I did a quick search and found the first one, but it works with a chrome extension (yikes), as it’s pre OpenAI API.

And I had seen the one with voice, which looks like an amazing PoC, but I wanted something text based.


There's no yikes, you install the extension from source and can use a different chrome profile


What about people trying to use any of the other browsers? Further if you have control over the server it makes more sense to do an extension there.


Disk space is cheap and it also works with Chromium which is open source. There's no reason not to temporarily run a browser if you would install an app to get the feature. A lot of things that should be extensions are apps and this ought to stop.


That’s fair, but is super opinionated and probably off putting to a lot of people (myself included). Hence the “yikes”.

Your last point seems irrelevant. This is about where the extension belongs - no one is making an app in this discussion and I would argue that a Chrome extension is much closer to an app than a Jupyter/IPython extension.


> That’s fair, but is super opinionated and probably off putting to a lot of people

...who have an unreasonable distaste for browsers they don't use that makes them not willing to use them as secondary browsers. Better to install an open source secondary browser than to force developers to make an app rather than an extension. Every time you install an electron app, you're installing a poorly distributed browser.

> Hence the “yikes”.

That's not what "yikes" means in this context.

It's implying a security problem when it was in some ways more secure than OP's project. If you use a browser extension to automate a free web app, you won't get billed a lot like if you use an API key for a paid API.

> Your last point seems irrelevant. This is about where the extension belongs - no one is making an app in this discussion and I would argue that a Chrome extension is much closer to an app than a Jupyter/IPython extension.

An app would be the alternative to the thing that OP said "yikes" about, because ChatGPT requires a web browser. Think an Electron app that puts ChatGPT in a web view. This is done with Gmail a lot rather than extension. A bigger hoop and much less secure than having someone set up a Chrome/Chromium profile, but many people find that more palatable because of the misinfo that gets spread about extensions being a "yikes" in all situations when it really depends on the situation.


Sorry, just saw this comment. I didn't imply "yikes" as a security problem, you're readying WAY too much on this whole thing.

That project was a good PoC while OpenAI didn't have an API; now that it exists, I'd not install a browser extension if not needed. That's all.


> by default, the %%chat command preserves the conversation to give the Agent some context, in the same way that ChatGPT works. You can "reset" its status passing the flag --reset-conversation.

What happens if you evaluate a bunch of cells in the notebook, then reset conversation and then evaluate say for example the 24th cell in the notebook? Does it get any additional context aside from said cell or not?


I should explain that better. The context preserved is just what has been invoked with `%%chat`. Any other cells are not passed as context.


I see. But let’s say that cells #8, #12 and #23 were originally invoked with %%chat. What happens then if you “reset” and then run cell #24?


The same as if you ran cell #24 before anything else.


You don't need an interface to just prompt and get a response from chatGPT it works pretty much out of the box with the API. I guess these interfaces make the interaction a bit more user friendly though.


Hey, kudos on getting this out. I just opened sourced a similar tool for the JetML platform.

https://github.com/jetml/jetmlgpt

Would love to collaborate!


This would be great in conjunction with e.g. papermill for running the same prompts over time and with the model as a parameter.

Do IPython-GPT or jetmlgpt work in JupyterLite in WASM in a browser tab?


I have only tested jetmlgpt using Jupyter notebooks.


JupyterLite How to docs: https://jupyterlite.readthedocs.io/en/latest/howto/index.htm...

"Create a custom kernel" https://jupyterlite.readthedocs.io/en/latest/howto/extension... :

> We recommend checking out how to create a server extension first

It may also be possible to just pip install the plain python package with micropip, or include it in a `jupyterlite build`; From https://github.com/jupyterlite/jupyterlite/issues/237#issuec... re: 'micropip':

  %pip install $@
  # __import__('piplite').install($@)
There's also micromamba, for mamba-forge packages (which are build with empack (emscripten) into WASM)


From core maintainers of Jupyter - https://github.com/jupyterlab/jupyter-ai


I’m guessing this works with GPT-4 if your API key has access to it. Is that correct? Going to check this out, currently I’m just using a CLI.


Seems like GPT-4’s model is not yet available through the API. You can check the available models with the `%chat_models` line magic.


You have to sign up for the waitlist: https://openai.com/waitlist/gpt-4-api

There is also a separate waitlist for ChatGPT plugins.


This is awesome! The IPython prompt was the last place I expected a tool like this, but I'm very excited to use it!


We released ICortex ai powered python interpreter half a year ago or so: https://github.com/textcortex/icortex


Also a different one: https://github.com/noteable-io/genai with additional magics.


This looks promising! I’m following.


Does anyone know if I can integrate this on Quarto? I use VSCode.


Congrats on the launch!

I created Mito, a spreadsheet the lives inside of Jupyter. We've seen a ton of our users using Jupyter and ChatGPT playground side by side.

We're also experimenting with bringing chatgpt into Jupyter through the Mito spreadsheet. (https://blog.trymito.io/5-lessons-learned-from-adding-chatgp...)

Looking forward to trying this out.


Cocalc also has new "generate a Jupyter Notebook from a [ChatGPT] prompt" functionality. https://twitter.com/cocalc_com/status/1644427430223028225


'2023-04-19: LaTeX + ChatGPT "Help me fix this..." buttons into our LaTeX editor' https://cocalc.com/news/latex-chatgpt-help-me-fix-this-butto...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: