I want to build business tools with ChatGPT Part 2: I tried plugging the ChatGPT API into a spreadsheet
I want to build a tool that displays the latest IT news
Hello. I'm a hungover guy. I'm about to waste the first day of my precious Golden Week. How is everyone doing?
I'm the type of person who easily falls into a lazy lifestyle when I let my guard down, but
as a bit of an IT salesman, I am serious about gathering IT-related information.
No, seriously.
I "glance" every day at IT-related news scattered around places like "ITmedia NEWS," "Business+IT," "Forbes," and "NewsPicks." Just a glance, you say?
However, reading the full text of articles and grasping the main points is quite a hassle.
If the content of an article is a bit difficult, I end up asking ChatGPT to summarize it for me. It's super convenient~
I feel like I can't live without you anymore.
That alone is quite convenient, but people always want to be even lazier. Especially a slacker like me who doesn't want to spend time on work as much as possible!
And honestly, I don't even want to work at all!! (That's not good, is it?)
If the latest IT-related information appeared in an instant, I could compress my precious morning time.Give me time to go back to sleep!
So, I will link a spreadsheet with ChatGPT and
"I want to create a tool where just by opening the spreadsheet, it gets ChatGPT to find the latest IT news for each topic and write down a summary."
I'd like to build such a tool.
Linking a spreadsheet with ChatGPT meansAPIwill be used.
"Application Programming Interface"
It's like a window to call functions.
I'll use this to make use of ChatGPT's features.
Let's do this!
How to build it
The method seems surprisingly easy when you look it up.
Basically 4 steps
1. Create a table in a spreadsheet
2. Install the "GPT for Sheets™ and Docs" add-on
3. Create an OpenAI API "API key"
4. Enter the API key into "GPT for Sheets™ and Docs"
1. Create a table in a spreadsheet
First, let's create a table in a spreadsheet.
Something like this, perhaps.

I'll try using a function starting with "=GPT" in the cell.
There are various GPT functions, so I'd like to try them out in the future.
This time, I'll just enter the instructions simply as follows.
=GPT($A2&"'s latest "&B$1&" summary, please tell me briefly.")
Yes, the table is ready now.
2. Install the "GPT for Sheets™ and Docs" add-on
Next, I'll install "GPT for Sheets™ and Docs" so that I can link the spreadsheet to the ChatGPT API.

You can search for it via [Extensions] -> [Get add-ons] in the spreadsheet, or just do a regular Google search; either way is fine.
3. Create an OpenAI API "API key"
Next, I will create an API key, but first, I will sign up from the site below.
If you already have a ChatGPT account, you can log in.

Proceed, and when you click the [API Key] tab from the menu on the left, it appears.

And then[Create new secret key]just press it and you are good to go.
What you need to be careful about here is thesecret API key.
It is displayed after you create it, but at this time,be sure to copy it to a notepad or a self-message to manage it.
It will never appear before you again after this.
Oh my~Be careful!
4. Enter the API key into "GPT for Sheets™ and Docs"
Well, the rest is to link this to the spreadsheet,
and it seems like it's okay if you just press [Set API key] and enter it like this.

I see, I see. Wait... huh?

Oh my goodness! The display is different from the image on the site I used as a reference.
Did the specifications change from before?
Darn you, "GPT for Sheets™ and Docs"! Give me a manual!
For now, open the menu.
[Extensions] => "GPT for Sheets™ and Docs" => [OPEN] => Menu appears on the right => The three-line icon on the top left => [API keys]
Aha! I found it! You really made me work for it.
By the way, the three-line icon is apparently officially called a "hamburger button".
Wow, wow, wow. I give it 3 "wows".

Alright! That's it.
Now let's see if it displays properly.

It says it cannot provide the latest IT news...
No way, what about the browsing feature!
I suspected that maybe I wasn't using the GPT-4 model, so I checked the details and...

GPT-4 doesn't exist in the model list!
So that's why it can't go fetch the latest articles.
But why isn't GPT-4 showing up?
Everyone should have been able to use the GPT-4 model since last year.
Actually, believe it or not...
To use the GPT-4 API, you need a payment history
Apparently, that is the case.
Until just a moment ago, I was acting like a customer-harassing jerk, shouting, "I've signed up for GPT Plus and I'm paying for it!!", but it seems that unless you have an API payment history separate from your Plus subscription, you cannot use the latest models.
Therefore,if you haven't exceeded the free tier or if it's your first time, you can't use the GPT-4 modelis what they say. I see, that makes sense!
Wait, that's no good!!
So, because I haven't spent any money on the API, I couldn't create the tool. Sorry, everyone! (What kind of excuse is that?)
However, there is quite a lot that can be done even with GPT-3.
For example, you can easily retrieve company information by category like this. It's not the latest, though.
Isn't this a bit convenient?

Summary
In the end, I couldn't create the tool this time. Well, once I'm able to use GPT-4, everything will be solved, so I'll report back once I've managed to do it.
But it's surprising how there are pitfalls in so many places.
It also took time to investigate these things I didn't understand.
I'm sure investigating things like this is also a matter of "getting used to it."
I felt that gaining a lot of experience is important.
I hear that even in development environments, there aren't many well-maintained manuals.
Various experiences through trial and error likely make it easier to predict causes and shorten the time to resolution. I will continue to work hard on trial and error.
