Your objective determines how you should build in Less
/lists/{list_id}/members
to get all your members in the list corresponding to list_id)https://api.openai.com/v1/chat/completions
URL with an
Authorization bearer token. You will also add a body which
tell the computer what to create for you.
The body consist of two things specific to OpenAI. This will
be familiar if you used ChatGPT. We’re sending a prompt to
OpenAI along with some input which in our case is the
review data from Amazon.
To the right, you’ll see how this is configured in the API
action inside Less. You’ll see that we are referencing
columns in Step #3 and #5 (e.g. [token]). In other words, we
have a column that contains our authorization bearer token.
The API action on the Less canvas works by sending one
API call per row in the dataset. As a result, it will take some
time to run the model - e.g. if you have 10.000 rows, you will
send 10.000 API calls (which takes time). It’s a good idea to
use a Limit action before the API tool while you’re testing to
avoid sending too many calls.
You need to create an account and bearer token at OpenAI. Go to https:/ /openai.com/ and create an
account. Go to API once you’ve logged in. Once you’re logged in, navigate to Settings and API Keys. Hit
the “Create new secret key” and make sure you store the key.
You also need to add funds to OpenAI. You can do that through Settings → Billing → “Add credit balance”. One call with all 30 rows in the reviews dataset costs around 0.0015USD per run. During the
entire testing phase while we built this exercise, we spent a total of 0.05USD. So you shouldn’t worry
about pricing (unless you start calling the API with millions of rows of data regularly…).
You are to evaluate the product reviews data on a scale from 0-10 where 10 is an absolute fantastic review and 1 is a horrible review. The product is a bluetooth speaker called Amazon Tap. ONLY OUTPUT AN INTERGER NUMBER BETWEEN 1 AND 10 (inclusive).
The table below is the result. We built it with 15 tools. The AI_review_score column is the one we created with AI.
Hint #1
You are to evaluate the product reviews data on a scale from 0-10 where 10 is an absolute fantastic review and 1 is a horrible review. The product is a bluetooth speaker called Amazon Tap. ONLY OUTPUT AN INTERGER NUMBER BETWEEN 1 AND 10 (inclusive).
In the Token column, we input our OpenAI API Key. Follow the steps in the Introduction Presentation to generate you own.Hint #2
Hint #3
Hint #4
Hint #5
(([sum_prompt_tokens]/1000)*0.0005)+(([sum_completion_tokens]/1000)*0.0015)