Quick Start with OpenAI and Salesforce
If you’ve joined in with us recently, you may not have all the tools you need to follow along with the projects. This page will get you ready.
0. Subscribe and Share
If you’re here, and you’re not a subscriber, fix that first!
If you are a subscriber, please share this substack with others!
1. Getting An Account With OpenAI
Most of the demonstrations in this substack use OpenAI as the backend LLM system. To use it, you’ll need to sign up for an account with them to get an API key. The costs of using OpenAI for simple demos are incredibly cheap; my June, 2023 bill from them was under $5. You are able to put a limit on your spending so you cannot accidentally run up a large bill. And they give you a few months of free usage to get started.
You can read the original post on the topic here, but in short:
Go to https://platform.openai.com/signup to sign up for an account.
Copy and save your sk-… API key (as you get to see it just once)
Set a low (e.g., $15) limit on your monthly usage here: https://platform.openai.com/account/billing/limits
2. Getting An OmniStudio Enabled Dev Org
Absent any other means of getting an OmniStudio enabled Salesforce developer or demo org, go to: https://trailhead.salesforce.com/promo/orgs/omnistudiotrails and sign up for one.
2.1 Creating a Named Credential
You can embed your OpenAI API key directly into your demos, although that’s a very bad idea. A good idea is to create a Salesforce named credential to securely hold your API key. My examples generally assume you have one named OpenAI.
The process of creating one is unfortunately a bit involved (but at least once it’s done you don’t have to revisit it). The instructions took up an entire post, which can be found here:
3. Working with Google Colab
Google Colab is one of those strange free1 things on the web that make you think “this won’t last”. It’s an environment that allows you to run Python code for free on Google’s servers without installing anything locally.
You just need a Google account and you’re ready to go. Any time you see people allow you to download a “.ipynb” file, this is a notebook you can run on Colab (almost always) or on your own computer.
I tend to publish simple examples on Colab because it makes it easy to see how things work with little effort and no cost.
https://colab.research.google.com
You can pay for better performance, but it’s not necessary for the examples I publish.