What happens if you combine GPT-3 and gSheets? Endless possibilities.
Lee Gonzales - Midjourney v4: cyberpunk desk scene neo tokyo outside

What happens if you combine GPT-3 and gSheets? Endless possibilities.

You know when you put something off for a long time, then you finally do it, and you think - WHY IN THE WORLD DID I NOT DO THIS SOONER ?!?!?!

So I love spreadsheets, not just because they are basically the first, crappy answer to nearly all business problems, but because they are incredible tools for thinking, modeling, and understanding the world. Which I suppose is why they are the tool people reach for most often when building janky tools and business processes :-)

I also love LLMs, and in specific OpenAIs ChatGPT, text-davinci-003, and text-davinci-002 models. I started playing around with these models last August and have been obsessed since then.?

But you know, I never really combined them with spreadsheets until this last weekend, and it is GAME ON for these two of my favorite technologies together, for the first time.

Like peanut butter and chocolate, only super geeky and super useful.?

So what am I talking about? Well (and a lot has been written about this, so I will be brief) how might we create a function in Google Sheets that can call one of OpenAIs APIs with a prompt and get a result??

What if these function calls worked in your gSheet??

  • GPTPromptCompletionInput($A2,$B2,0.7, "text-curie-001",1024)
  • GPTPromptCompletionInput($A2,$B2,0.07, "text-davinci-002",512)
  • GPTPromptCompletionInput($A2,$B2,0.7, "text-davinci-003",512)

Then you could produce a sheet and see clearly what each model produces given the same prompts like so:

No alt text provided for this image
Prompts vs Models Outputs in gSheets

Or maybe you want to chain prompts together, get some output from one and use it as input for another?

No alt text provided for this image

The possibilities are ENDLESS.?

A few things you could do by combining LLMs and Spreadsheets

  • Text classification: Automatically categorize text data based on pre-defined categories or LLM provided categories.?
  • Text generation: Generate text based on certain parameters and seed data for marketing copy, emails, ads, etc
  • Sentiment analysis: Determine the sentiment of text data and categorize as positive, negative, or neutral. Or score it on other rubrics.?
  • Named entity recognition (NER): Extract and categorize entities such as names, organizations, locations, etc. from text data.
  • Text summarization: Automatically generate a summary of long text documents.
  • Translation: Translate text data from one language to another.
  • Question answering: Automatically answer questions based on text data.
  • Data enrichment: Enrich data in a spreadsheet by adding information extracted from text data.

How to get started?

  1. You will need to signup with OpenAI and get an API key. It is easy, but it does require payment information.?
  2. Copy this gSheet - it has the function I am wrote already embedded as an App Script.
  3. Update the line in the script with your API key
  4. const OPENAI_API_KEY = ""; // <- PASTE YOUR SECRET KEY HERE
  5. Keep the https://platform.openai.com/account/usage open as you play around as this is an exceedingly easy way to make a LOT of API calls. Now you can spend some real money here, like 2 dollars.?
  6. Now go play around, what did you build? Let me know in the comments.?

As always YMMV, OpenAIs servers are slammed so timeouts are common, ask questions and/or please give me feedback in the comments.?

Cheers

Lee

Pierre Bouvier

Senior Marketer | Webfleet ? Bridgestone Mobility Solutions

1 年

Great content??? Lee Gonzales?! I really find useful your primary prompt approach and?the content style prompt previously mentioned in your posts on GPTChat, thanks !? In your opinion, can the primary prompt approach you developed for GPTChat be set in a G-Sheet using text-davinci-003 ? In my dream scenario, this primary prompt would set the scene (writing style, capabilities and function) and then have 2ndary, 3rd, 4th levels of prompts chaining and interacting successively with results in cells ? Is this something you believe would be useful and functional in a G-Sheet (or a colab as well) ?

回复

要查看或添加评论,请登录

社区洞察

其他会员也浏览了