- CaffeinatedGPT
- Posts
- 6 Lines Is All You Need π
6 Lines Is All You Need π
A lighthearted guide to the changing landscape of large language models

4 Min Read β’ Intensity: βοΈ βοΈ βοΈ
Good morning, Caffeinators βοΈ
Hold on to your mugs, decaf and latte drinkers! This week's newsletter packs a punch! We're exploring a tutorial on implementing the GPT API and the incredible possibilities it unlocks.
Todayβs Starting Sips:
Unleashing GPTβs full potential with APIs π
Exploring GPTβs possibilities & limitations π
Tip of the day: A dose of digital delight ποΈ
GPT API Explosion π
Months ago, GPT released its API to the public, but it wasn't until ChatGPT burst onto the scene that it truly gained traction.
The brilliant move? Making the API accessible through Python, the simplest scripting language.

6-Lines is all it takes
To demonstrate, here is a GPT API call to ask for a coffee joke:

Awful joke, but worth a chuckle π
If you are code motivated, you can copy it from here.
So what can you do once youβve learned these API calls? Here are some examples!
Get Inspired by GPT API Creativity π«
While a user interface is visually appealing like ChatGPTβs website, it limits the customer experience to one dimension.
With GPT API, you can add more complex logic to your backend for a richer experience. Here are some cool examples:
Get Ready for AI That Trains Itself π§
AutoGPT takes human intervention out of the AI training equation. It involves two GPTs conversing and critiquing each other until specific criteria are met, all at lightning speed.
The self-training capability of Auto-GPT paves the way for endless opportunities.

Gear auto turns βοΈ
For example, you can have one GPT as a product manager and the other as a software engineer. The goal is to develop Flappy Bird. Below is a live conversation the GPTβs are having.
When AI makes Group Chats π
The college-era group chat holds a special place in our hearts. What happens when AI meets this digital sanctuary? Meet Robo Boys
Izzy Miller trained an uncensored large language model on the group chat with LlaMa and Hex led to some jaw-dropping results. Prepare to be amazed (and possibly horrified)!

This is just the tip of the ice berg π§
Limitations of GPT API π«
Has 0 Memory π§
GPT API does not hold up a conversation like GPT in the web. Each API calls is independent from each other.
In other words, it will not remember what you tell it to do even though it was 2 seconds ago.

Memory like π‘
Yes, Greg Baugues developed 16 lines of Python code to make the API calls βchattableβ. It is a brilliant idea and works just like ChatGPT on the web.
Built a command line chatbot in Python with the ChatGPT API. 16 lines of code. I'm not sure anyone's ever shipped a more powerful devtool than OpenAI.
β Greg Baugues (@greggyb)
2:39 AM β’ Mar 2, 2023
However, as you chat on, you will quickly realize that you hit the max token limit since Gregβs solution is to store all the message history in a list.
No GPT 4 π«
Meanwhile, the gpt-4 model is in Beta and requires a waitlist to join. Publicly, there is no access to GPT 4 via API.
OpenAI, if you're reading this, please let me in. I'll buy you coffee β thank you!

I can go on about why GPT 4 is waaaay better than GPT 3.5, but that will be another article.
Tip of the Day: Grounding π
Set a context with GPT by using a technique called grounding. This approach involves setting a predefined role for the system, ensuring it consistently follows through with future repeated commands.
Establish context, and watch GPT seamlessly interact within the given parameters.

Subscribe to Caffeinated GPT β ππ©πβοΈ
To-Go Cups π₯€
6-lines of Python unleashing GPT 3.5 π
GPT APIs ignites innovation π₯
Grounding GPT for repeated tasks π
Until next time,
Your friendly tech barista and βοΈ GPT!
Reply