Late in 2023, I was considering writing an article about
This project was so exciting that a month later, Acorn
I’ve been following all the developments on this project, closer than I typically do, because I find it absolutely amazing as enablement technology. It reminds me of the philosophy behind a product I worked with back in the 80s and 90s called MPEX from VESOFT, written by Eugen Volokh.
What Darren has done with GPTScript is kind of hard to wrap your head around at first, especially for a programmer. I haven’t spent enough time with it yet to fully understand all the implications, but I have a lot of thoughts about it.
In this article, I’ll walk through some basic introductions and examples and give you some thoughts about where you could take it.
I worked off the
winget install gptscript-ai.gptscript
$env:OPENAI_API_KEY = 'your-api-key'
The docs suggest running a “hello world” example at this point, but that isn’t very interesting, so let’s try the “bob” example. Also, note that there are many built-in examples you can get a list of by issuing the gptscript—-list-tools command and an online ‘
What does “bob.gpt” look like?
This presents us with some obvious questions, like what this all means and how a value of ‘How are you doing?’ ended up in the ‘question’ argument. GPTScript operates around the notion of tools where a tool is described in a GPT file. Each file can be made up of more than one named tool, separated by three dashes.
Borrowing from the docs, Tool parameters are key-value pairs defined at the beginning of a tool block before any instructional text. They are specified in the format key: value. The parser recognizes the following keys (case-insensitive and spaces are ignored):
A tool starts with a preamble that defines the tool's name, description, args, available tools, and additional parameters. The preamble is followed by the tool's body, which contains the instructions for the tool. Comments in the preamble are lines starting with # and are ignored by the parser. Comments are not really encouraged as the text is typically more useful in the description, argument descriptions, or instructions.
I’m still not sure why Bob was giving a default value for the argument. It would change if I gave it an argument, so that was a bit of a mystery. I decided to try the samples-readme.gpt script, which looks like this:
Reading this, I understood that it would give me a summary of each gpt file in the examples directory. When I first tried it without an argument, it failed to find any input, so I tried with an example file as an argument, and it worked.
Then I tried it with their larger example script for hacker-news-headlines, and instead, it did what I thought it should have done the first time. It created a readme.md file in the examples directory with a summary of each example.
I’ve seen people in the community starting to generate some very cool tools that are being added to the GPTScript tools web page. I had a little bit of mixed results with my tests. Most things worked as expected, but I had a few things that didn’t, and I didn’t have the opportunity to dig deeper. That said, this is clearly powerful, and it is just scratching the surface.
As a lifelong programmer, this feels weird; it involves doing things in ways that seem like something is missing. This makes GPTScript fascinating and scary as if black magic is involved somehow. The natural language and loose feel of it take a little getting used to, but as you think about it, you start to realize how amazing this can be as an enablement technology.
One of the first things that came to mind, but I didn’t test, was could this be used to drive
My mind starts to explode thinking about it. Acorn has created an online “
Check out my other What the Heck is… articles at the links below: