URLをコピーしました!
スキルアップを始める!

【Googleスプレッドシート】ChatGPT関数|ChatGPTと連携してデータを取得する方法(ChatGPT in Google Sheets™ and Docs™)

Googleスプレッドシート
\スプレッドシートのスキルアップはこちら!/ スプレッドシート
\ワードプレスのスキルアップはこちら!/ WordPress入門読本

ChatGPTのAPI(ChatGPT関数)を使ってスプレッドシートにデータを自動連携させてみます。

ChatGPT in Google Sheets™ and Docs™をインストールする

まずは、marketplaceから「ChatGPT in Google Sheets™ and Docs™」という拡張機能をインストールします。

GPT for Sheets™ and Docs™ - Google Workspace Marketplace
ChatGPT in Google Sheets™ and Docs™. Get the full power of AI for inspiration data cleaning, classification, extraction,...

インストール完了しました。

APIキーを取得する

ChatGPTの設定画面のView API keysからAPIキーを取得します。

OpenAI Platform
Explore developer resources, tutorials, API docs, and dynamic examples to get the most out of OpenAI's platform.

Create new secret key からキーを取得します。

SECRET KEYが取得できました。

ChatGPT関数を設定する

拡張機能にChatGPT in Google Sheets™ and Docs™が追加されていますので、Set API keyからAPI keyを設定します。

API keyを貼り付けして、Save API keyで設定完了です。

[rml_read_more]

ChatGPT関数を使う

ChatGPT関数を使ってみます。

このような引数になっているようです。

GPT(prompt, [value], [temperature], [max_tokens], [model])

概要
Submits a prompt to GPT and returns the completion
prompt
Prompt to submit to GPT
[value]
OPTIONAL – Value to be concatenated at the end of the prompt
[temperature]
OPTIONAL – Creativity (value between 0 and 1) Default: 0
[max_tokens]
OPTIONAL – Max tokens to use in the request (< 4000) Default: 256
[model]
OPTIONAL – Model name (e.g. text-davinci-003) Default: text-davinci-003

Error: your OpenAI free trial is expired. Please set up a paid account on OpenAI dashboard: https://platform.openai.com/account/billing/overview(行 1999)が発生しました。

「使用制限に達しました」というエラーが表示されました…。

API Keyを何度も設定していると、エラーが表示されましたので注意が必要です。

Your OpenAI free trial is expired. Setting up an OpenAI paid account should help accelerate the activation.
OpenAI の無料トライアルの有効期限が切れています。 OpenAI の有料アカウントを設定すると、アクティベーションを加速するのに役立ちます。

Your API key is never stored on our servers. It is stored in your Google account in a dedicated safe container. Once set, it won’t be visible to anyone.
API キーがサーバーに保存されることはありません。 専用の安全なコンテナ内の Google アカウントに保存されます。 一度設定すると、誰にも表示されません。

まとめ

ChatGPT関数を使ってデータを取得するまでの流れでした(エラーが出ましたが…)。

API keyの使用の場合は有料版になる必要が今後出てきそうですので、使用頻度などに合わせて検討してみましょう。

Kindle Unlimited 会員は無料で購読できます
購読はこちら
Kindle Unlimited 会員は無料で購読できます
購読はこちら