Thursday 19 May 2022

Using Natural Language AI in Your Next Project is Easier Than You Think

I've been playing around a lot with OpenAI's natural language API, which is an interface to GPT-3 and it's opening all kinds of doors for me lately.  I wrote an article published on Hackaday covering the basics of what it can do and how to get started.  Short version?  If you can code some basic Python, write a curl statement, or even just use the command line, you already have all the tools you'll need to get started!

Here's a fun little utility I wrote to learn the ropes. The "technobabbler" converts otherwise boring log messages or status reports into technobabble. Here are a few examples, below. 

Note that results are never really the same and cannot be predicted. I find this kind of uncertainty fascinating; the way that responses are not predictable yet not actually random is deeply interesting to me.  

Below, multiple responses are shown below each command to demonstrate this. (The technobabbler actually only returns one response at a time.)

echo "Connection lost" | ./technobabbler.py

All systems are down. We are cut off.

Subspace carrier has lost coherence.

echo "Connection established" | ./technobabbler.py 

Accessing subspace frequency...

We have a green light

Subspace carrier has locked on.

echo "Power low. Please charge now." | ./technobabbler.py 

Insufficient energy levels. Please provide additional power.

Power reserves are running low. Please recharge as soon as possible.

echo "Display not found" | ./technobabbler.py 

Monitor not active.

There is no display device on the specified port

No compatible output devices detected



No comments:

Post a Comment