Article Preview
Buy Now
COLUMN
More Using ChatGPT
Have ChatGPT Correct Your Grammar
Issue: 22.4 (July/August 2024)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 17,540
Starting Page Number: 42
Article Number: 22406
Resource File(s):
project224006.zip Updated: 2024-07-01 10:15:36
Related Link(s): None
Excerpt of article text...
In last issue's
Beginner's Corner , I wrote about using ChatGPT within your app to summarize text. This time, after watching Apple's WWDC announcements and how ChatGPT will be able to help you with your grammar in texts and emails, I decided to see how effective it is right now at doing that within a Xojo app.I learned several lessons in this process that I think you'll find valuable.
To get started with our app, we first open the ChatGPT example project included with Xojo 2024R1 (see Figure 1). You'll then want to copy the
ChatGPT
folder into your project. This folder contains two classes,ChatGPTException
andChatGPTConnection
. (You could also make a duplicate of last issue's ChatGPT Summary example and edit that project.)As before, this example will require an OpenAI Account and an API key. (See my instructions on how to do this in
xDev 22.3 on page 83.) This isn't free as you are charged for API usage, but the charge is relatively minimal (think pennies, not dollars).Get the Right OpenAI Account!
One more important lesson I learned is that there's a huge difference between an OpenAI API account and a regular OpenAI ChatGPT account. I've no idea why they make it so confusing, but when I logged into my ChatGPT account saved in 1Password it was the regular one, not the API account. These two accounts use the same username and password—I only have one OpenAI account—but you access them with different URLs (
https://platform.openai.com
is for API access).
...End of Excerpt. Please purchase the magazine to read the full article.