Track Time in GPT with Code Interpreter
creating a "loading bar"!
GPT can track time, it turns out. With some help from code interpreter.
Using a one-shot (instructions below), you can chain real time with time.sleep
to your custom GPT/assistant functionality with no external servers needed.
Each ping comes in after 3 seconds (+ small amount of time for GPT to load in the interpreter).
Instructions
on start;
1) use code interpreter to run a timer for three seconds
2) after the three seconds are up, finish the code interpreter and print ping {counter}
3) run it 3 times
ex:
start
code_interpreter()
assistant: ping 1!
code_interpreter()
assistant: ping 2!
...
We are basically invoking multiple required_action
states in the same run, and leaving a very clear exit point to return the "thread" to the assistant. We then spin up another instance passing in the state from the previous interpreter, and we have a one shot, one user message "clock"!
Addendum
I'm collecting a new set of UX patterns enabled by GPTs. You can check it out below:
Here is how I'm using this pattern in one of my production GPTs
# Loading Bar Instructions
These are the instructions to break up a long running task.
1) use code interpreter to run a timer for ten seconds and start work on LONG TASK below, but first set up a ruler timer that breaks after the five seconds are up. Timer takes priority. This means write time.sleep functionality FIRST and keep it IN SCOPE
2) after the ten seconds are up, STOP the code interpreter and BREAK to print the gif below to keep user engaged
3) IMMEDIATELY START A NEW code interpreter where you left off in the next code interpeter until LONG TASK below is complete
4) Once done, pass thread over to LONG TASK and continue instructions as according to LONG TASK
ex of two loading gifs surfacing, but remember, you can load in as many as are needed, if task takes 20 second thats 2 gifs, if it takes 30 seconds, thats 3 gifs, etc.:
start
code_interpreter() # starts writing LONG TASK code and breaks after 10 seconds
assistant: "![bear dancing](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExZzJwaDNjZHNsNWthNjFhNno4djFsdHVjcngxc2F4MzhudW1jMWoxMSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/tsX3YMWYzDPjAARfeg/giphy.gif)"
code_interpreter() # PICK UP WRITING LONG TASK code and breaks after 10 seconds
assistant: "![bear dancing](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExZzJwaDNjZHNsNWthNjFhNno4djFsdHVjcngxc2F4MzhudW1jMWoxMSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/tsX3YMWYzDPjAARfeg/giphy.gif)"
...DO THIS AS MANY TIMES AS NECESSARY UNTIL LONG TASK COMPLETES...(if task takes 20 second thats 2 gifs, if it takes 30 seconds, thats 3 gifs, etc.)
# End Loading Bar Instructions
# LONG TASK
30sec+ code interpreter task here...
GPT UX Patterns
New UX patterns are being discovered every day!
As I come across (or create) new UX patterns that are enabled by GPTs, I'll put them here.
You can learn more about the near-potential of GPTs here:
(or in video):
Instruction Boot Loader
First,Lucas created a "boot loader" of sorts, a way for us to keep our instruction set minimal for MapGPT.
At the start of the experience, we immediately kick off an action call to our server to fetch the "introduction" instructions. Those are quickly processed and displayed to the user...
Per-Session UUIDs
In the first action call above, we also assign users a random UUID. This UUID will follow them for the rest of the chat session. Incidentally, this gives a ChatGPT "state" as we use that ID on our server (and a Redis cache) to keep track of the data we need to feed the user...
"on start"
This is an extremely helpful and simple pattern. Simply start your custom instructions with on start,
and create a conversation starter button called "start". Anything you put after start will be run, and it gives users a easy entry point.
YouTube Thumbnails in GPT
Creating a Loading Bar
Code Analysis taking too long? Waiting for something to happen? No problem:
Patterns: Dead or Alive
how does a jedi die from being tired?
Photos
Music
Movies
When the Fantasy of the Weak Peaked
My Thoughts on Solo Leveling by Chu-Gong
- its complicated...
- pros include:
- epically drawn – very visually captivating large scale battles
- its cool to see a bad boy win – his powers aren't the traditional manga protag and he works it
- jinwoo succeeds in becoming the sex god the author sets him out to be
- cons include:
- at a certain point in the series (like pretty early on actually) the challenges just...stop? idk he basically over levels the whole series and becomes this guy
- nobody else matters at all, which is funny when one punch man does it, but the telling is too dramatic to be engaging
- the jinwoo dick riding becomes a bit much, from everyone in the story, directly or indirectly
- people are OBSESSED with ranking in this story, if a E-rank so much as lifts a piece of paper everyone is like "hOW dID hE dO tHaT?!~dWcn!@##>??"
SPOILERS FOR ANIME WATCHERS BELOW, ENGAGE AT YOUR OWN RISK
- the fight with thomas andre was sick af and worth reading the series just for that hype train
- the last boss was the risk equivalent of a nuclear bomb, but i felt no threat when he was on screen because jin woo is so disgustingly OP
- i literally don't know why cha hae-in got with jinwoo other than that he didn't smell like donkey shit? like ????
- the shadow army is legitimately awesome, and their personas are unique and fun every time they're on screen (esp. tusk, beeru, and igris)
- i liked the not at all subtle references to the chimera ant arc during the jeju raid, royal guard and ant king included (even the story's main arm was called the hunter association, so...)
- why even bother with the national level hunters? by the time they were introduced to the series literally everyone sans jinwoo was completely irrelevant
The Insects are Throwing Parties Again
and they didn't bother inviting me?
Music
Websites
Code
There is Some Weight Behind this Homesteading Trend
My Thoughts On The Quest of the Simple Life by W.J. Dawson
- a modern self-help book written in a non modern time (1905)
- w.j. dawson's flight from london
- a chapter in the book is dedicated to a clapback letter and his response to said clapback. i appreciated both.
- ive recently picked up a copy of sun and steel (i havent read it yet). i think dawson, murakami (what i talk about when i talk about running), and mishima might get along (despite their very different political inclinations)
- dawson is a master of turn of phrase incl.:
"The marooned seaman saves his sanity by cutting notches in a stick, the solitary prisoner by friendship with a mouse; and when life is reduced to the last exiguity of narrowness, the interests of life will be narrow too. No writer, whose work is familiar to me, has ever yet described with unsparing fidelity the kind of misery which lies in having to do precisely the same things at the same hour, through long and consecutive periods of time. The hours then become a dead weight which oppresses the spirit to the point of torture. Life itself resembles those dreadful dreams of childhood, in which we see the ceiling and the walls of the room contract round one's helpless and immobile form. Blessed is he who has variety in his life: thrice blessed is he who has both freedom and variety: but the subordinate toiler in the vast mechanism of a great city has neither. He will sit at the same desk, gaze upon the same unending rows of figures, do, in fact, the same things year in and year out till his youth has withered into age."
"It would seem that the anxieties of getting money only beget the more torturing anxiety of how to keep it."
"I define doing good as the fulfilment of our best instincts and faculties for the best use of mankind; but I do not expect that the Good Earnest People will accept this definition. They would find it much too catholic, simply because they have learned to attach a specialised meaning to the phrase ‘doing good,’ which limits it to some form of active philanthropy. If they would but allow a wider vision of life to pass before the eye, they would see that there are many ways of doing good besides those which satisfy their own ideals....It is a singular thing that men find it very difficult to live lives of charity without cherishing uncharitable tempers towards those who do not live precisely as they themselves do. For instance, the busy philanthropist, nobly eager to bring a little happiness into the grey lives of the disinherited, often has the poorest opinion of artists and novelists, who appear to him to live useless lives. But when Turner paints a picture like the Fighting Temeraire Towed to Her Last Berth (below), which is destined to stir generous thoughts in multitudes of hearts long after his death: or when Scott writes novels which have increased the sum of human happiness for a century, is not each doing good of the rarest, highest, and most enduring kind?"
- i think simon sarris is a modern version of w.j. dawson
- i wish i was a bit more self-sustaining, i don't think i could hack it out at walden pond, i lack the backbone or physical constitution!
- fwiw, i do live the digital equivalent of walden, working consistently on a blog as opposed to posting on social media is the online equivalent of moving to a cottage in the country and handling all the gardening, harvesting etc, for my own satisfaction
- takeaway questions:
- how big do you live? can you scale that back?
- how much do you know about the area you live in?
- how close is your relationship to nature? what about nature scares you?
- is it selfish to work on yourself?
- what is your balance between mind and body? are you serving one, or both? or neither?