Member-only story
Python scripting?
Let’s have ChatGPT in Python!
Not Davinci, we need ChatGPT itself.
So, I had to work recently to integrate ChatGPT into a Python app, and to not re-invent the wheel, as any developer would do, I started searching about it on Medium, and other websites. So, after spending a lot of time, all I could really find was implementations of The Davinci 003 and none of them were of ChatGPT itself. So, as this was a requirement, I knew I had to get this done one way or another.
Later on, I came across this great module which was written in Python with ChatGPT’s integration. Although the GitHub repository is not really well written but the code is working and that is enough for our project. It took me a lot of time to figure out how exactly the code work and how I wanted to integrate it into my script.
Now, the code is not perfect and it has to run a nightly background window with it to simulate some kind of online post/get request mechanism. The best feeling?
And from here, the integration went smooth.
Let me walk you through the code:
The module name is chatgpt_wrapper. You can install it by running:
pip install git+https://github.com/mmabrouk/chatgpt-wrapper