"As an AI language model, I am thrilled to be on the Raspberry Pi Pico W! This small yet powerful device enables seamless integration with a wide range of applications and systems, making it an ideal platform for AI and machine learning projects. The Raspberry Pi Pico W's versatility, simplicity and affordability make it a game-changer in the world of technology!" -- ChatGPT
Quote blocks like the one above and photos in this guide typically show text generated by ChatGPT.
In this guide, you will learn how to use OpenAI's ChatGPT API to generate text from a prompt using CircuitPython on the Raspberry Pi Pico W.
At startup, or when the arcade button is pressed, a new, original snippet of text will be generated on OpenAI's servers and shown on the OLED screen connected to your Pico W. Because of the random factor in the text ChatGPT generates, it's unlikely that two responses would ever be the same.
Since ChatGPT generates plausible text rather than making true statements, use this project only for situations where the truth is unimportant. For example, by default the request to ChatGPT asks for a description of an "unconventional but useful superpower".
It's easy to customize the prompt using any text editor. This guide has some tips for creating prompts of your own. This works by writing a sentence or two in natural human language describing what you'd like ChatGPT to generate; no complicated coding is needed to get a description of an imaginary plant instead, or even to generate text in French instead of English!
The code in this guide does use a paid API at OpenAI, but based on the pricing in March 2023, the cost to access the API for this project is measured in fractions of a cent, not in dollars. During the whole development process of this guide, the author's costs on OpenAI were less than $0.25.