Run Interactive Sessions With ChatGPT In Jupyter Notebook

Author:Murphy  |  View: 27296  |  Time: 2025-03-23 18:42:13
Original photo by Charles Etoroma from Unsplash.

In March 2023, OpenAI released its API for developers to access ChatGPT and its Whisper models. Since then, developers can integrate these services and models into their applications and products via their API. Many great tutorials have then been published on how to create your own ChatGPT Chat web app using their API together with Streamlit or Streamlit Chat.

This article proposes a lighter-weight approach. Instead of running or hosting a Streamlit server or working with Docker containers, all the work is done in a Jupyter Notebook.

In this article, you will learn how to run interactive sessions about your custom documents with OpenAI's LargeLanguageModel (LLM) ChatGPT in Jupyter Notebook by using LangChain and IPyWidgets.

The final result will look like this:

Figure 1. Demo of the final result (image by author).

The following chapters will explain each part of the code separately.

Tags: ChatGPT Data Science Jupyter Notebook Machine Learning NLP

Comment