Skip to content

Instantly share code, notes, and snippets.

View ruphy's full-sized avatar
🔮
working

Riccardo Iaconelli ruphy

🔮
working
View GitHub Profile
@ruphy
ruphy / GPT3.js
Last active November 2, 2023 23:41
GPT3() function for Google Sheets
// SPDX-License-Identifier: MIT
//
// This code will add a GPT3() function in your Google Sheets
// This code is originally inspired from https://twitter.com/fabianstelzer/status/1572926883179778050
// To use it, insert your API key below, open Google Sheets -> Extensions -> Apps Script -> Copy & Paste this -> Save
//
// Usage: =GPT3(prompt, max_tokens (default=15), model (default=davinci))
// Example usage: =GPT3("Once upon a time,", 1000, "davinci")
var API_KEY = "your-API-key";

Keybase proof

I hereby claim:

  • I am ruphy on github.
  • I am ruphy (https://keybase.io/ruphy) on keybase.
  • I have a public key ASAoPi10JGGW2yu680FppL7Y38twVRzXWTPv9UyphiaIkAo

To claim this, I am signing this object:

#!/usr/bin/env ruby
$first="75ae56f7ffbc5be14e532e004314e421213107cc"
list = String.new(`git rev-list --first-parent #{$first}..HEAD`)
a = Array.new()
list.scan(/\w+/) { |s|
We couldn’t find that file to show.
m km 1 v