OpenAi & AppSheet #1.2 | The Script

Опубликовано: 29 Октябрь 2024
на канале: MultiTech Visions
4,438
65

How to create an continued conversation system using #OpenAi and #AppSheet.
aka: how to create an interaction similar to #ChatGPT in an AppSheet app

MODEL NOTE: This video shows how to utilize `text-divinci-3` as the primary model
This model has been depreciated since this came out.

(NEW APP THAT SUPPORTS GPT4)
https://www.appsheet.com//templates/C...

Skip the build, Copy the app
https://www.appsheet.com//templates/C...

This is part 2 of 4 for the series; in this portion of the series I'll cover how to use ChatGPT to generate the Google Apps Script needed to send data to the OpenAi text completion API endpoint and return the result, and how to integrate that into your AppSheet app using an Automation bot.

To generate the script, you can use the following prompt:
-----------------------------------------------------------------------------------------------------
Google Apps Script function to take a 'prompt' parameter and fetch OpenAI completions using the API endpoint https://api.openai.com/v1/completions, model text-davinci-003, maximum 500 tokens, returning the completion text (result.choices[0].text) and token usage (data.usage.total_tokens) in an array format (converting the token usage to a string).
-----------------------------------------------------------------------------------------------------


Table of Contents |----------------------------------------------------------------------------------------
0:00 Intro
0:39 Overview of the script prompt
1:20 Using ChatGPT to generate the script
2:06 Where to put the script so AppSheet can use it
3:34 Starting the Automation Bot
5:50 Recording the token usage
7:58 Recording the script return values in AppSheet
9:22 Why return the tokens as a string?
10:36 Adding your API key to the script
11:20 Testing for a response
12:06 Ending

-----------------------------------------------------------------------------------------------------------------------

/////////////////////////////////////////////////////////////////////////////
/// SUPPORT THE CHANNEL
/////////////////////////////////////////////////////////////////////////////
//
// Answer Portal
// https://www.multitechvisions.com/answers
//
// Merch
// https://multitech-merch.creator-sprin...
//
/////////////////////////////////////////////////////////////////////////

For more information about MultiTech Visions, visit
www.MultiTechVisions.com

Business Inquires: [email protected]