Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 22.4 ('Spy On Your Variables')
Instant purchase and download via GumRoad!

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):

Download Icon 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 and ChatGPTConnection. (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.