GPTVISION Function Reference

Edited

Description

Sends an image along with a prompt for evaluation.

GPTVISION allows SheetGPT to effectively "see" the contents of the image and do some evaluation on the image itself.

The following will look at web page and pass it to the default AI model along with the prompt to describe its contents in one sentence.

=GPTVISION("Describe the product in this image", "https://assets.adidas.com/images/h_840,f_auto,q_auto,fl_lossy,c_fill,g_auto/4e894c2b76dd4c8e9013aafc016047af_9366/Superstar_Shoes_White_FV3284_01_standard.jpg")

If you want to use the value in another cell as the prompt, you can do so by directly passing it in:

=GPTVISION(A1, A2)

Syntax

=GPTVISION(prompt, image_url, gpt_model, temperature, max_tokens, cache)

The function parameters are as follows:

Parameter

Required

Default

Description

prompt

Yes

String (or cell reference) representing a user prompt)

image_url

Yes

The URL of the image that should be passed with the prompt to the AI model

gpt_model

No

gpt-4o-mini

String representing the OpenAI GPT model to use. See the list of available models for usage and pricing details.

temperature

No

1

Number between 0 and 1 representing how much variance to introduce when responding. 0 is very little variance and 1 is the most variance.

max_tokens

No

1000

Number representing the max number of tokens to return as the response.

cache

No

true

Whether or not to cache the response. Setting to false will incur a re-execution on every cell refresh.

Sample Usage

=GPTVISION("Describe the product in this image", "https://assets.adidas.com/images/h_840,f_auto,q_auto,fl_lossy,c_fill,g_auto/4e894c2b76dd4c8e9013aafc016047af_9366/Superstar_Shoes_White_FV3284_01_standard.jpg")

Advanced Options

The GPTVISION function accepts several optional arguments which you can use to further control the response to your prompt. Here are some examples:


Specify a different GPT model

The third argument to GPT lets you specify a different OpenAI model to use when responding to your prompt. The default model is the best blend of cost-efficiency and performance. If you have more specific needs you may use one of the other OpenAI models instead:

=GPTVISION("Describe the product in this image", "https://assets.adidas.com/images/h_840,f_auto,q_auto,fl_lossy,c_fill,g_auto/4e894c2b76dd4c8e9013aafc016047af_9366/Superstar_Shoes_White_FV3284_01_standard.jpg", "gpt-4o")

Using non-default models (such as GPT4o) may consume your SheetGPT usage credits at a much higher rate than the default model. Please make sure you understand what you are doing before using a different model.


Adjust the variety of the response

The fourth argument to GPT lets you specify a different "temperature" to use for the response. The temperature is a number between 0 and 1 (so a decimal like 0.5) that defines how much variability you want in your response.

=GPTVISION("Describe the product in this image", "https://assets.adidas.com/images/h_840,f_auto,q_auto,fl_lossy,c_fill,g_auto/4e894c2b76dd4c8e9013aafc016047af_9366/Superstar_Shoes_White_FV3284_01_standard.jpg",,0.1)


A higher temperature like 1 (the default) means you are likely to get very different responses to the same prompt - there is more "drift" in the responses. Use a lower number like 0 or 0.1 if you want more determinism in your responses.


Limit the length of the response

The fifth argument to GPT lets you specify a response length limit (in terms of tokens, which roughly equals half an average word in length). So if you want to limit the length of your response to about 15 words you could pass in 25 as the fifth argument to GPT:

=GPTVISION("Describe the product in this image", "https://assets.adidas.com/images/h_840,f_auto,q_auto,fl_lossy,c_fill,g_auto/4e894c2b76dd4c8e9013aafc016047af_9366/Superstar_Shoes_White_FV3284_01_standard.jpg",,,25)‍

Performance & caching

‍The completion that is returned is cached by SheetGPT to ensure that cell refreshes and other Sheet actions do not cause an unnecessary burn on your tokens.

Any GPTVISION request with the same arguments in a Sheet will return the cached value, indefinitely. This is well beyond the typical 6-hour cache limit of most Sheet plugins and is our attempt to make SheetGPT the most cost-effective way to utilize various GPT functionality.

If you ever need to avoid hitting the cache and force the generation of a new response, you can set the cache argument to false to force re-generation:

=GPTVISION("Describe the product in this image", "https://assets.adidas.com/images/h_840,f_auto,q_auto,fl_lossy,c_fill,g_auto/4e894c2b76dd4c8e9013aafc016047af_9366/Superstar_Shoes_White_FV3284_01_standard.jpg",,,,false)