Skip to main content
Allows you to call a model from a cell formula and specify the model as the first argument. This overrides the default model.

Arguments

providerAndModel
string
required
A string on the form “provider/model” (e.g., “openai/gpt-4o-mini”).The default model is determined by your configuration settings.
instructions
string
required
Your prompt - the instructions for the model to follow.Can be a string, a cell reference, or a range of cells.
cellsOrTemperature
string | number
Either context cells or a temperature value:
  • If providing cells: A cell reference or range (e.g., A1:D10). The model will use these cells as context when following your instructions.
  • If providing a temperature: A number (0.0-1.0) or preset string to control randomness when no context cells are needed.
temperature
string | number
default:"0.0"
Controls randomness in the model’s output.Accepts either:
  • A number between 0.0 and 1.0
  • A preset string:
    • "Consistent" (0.0) - Deterministic output, same result each time
    • "Neutral" (0.3) - Balanced between consistency and variety
    • "Creative" (0.7) - More varied and creative outputs
Lower values (closer to 0) produce consistent, deterministic responses. Higher values (closer to 1) produce more varied, creative responses.

Returns

response
string
The model’s response as plain text.
=PROMPTMODEL("openai/gpt-4o-mini", "Extract keywords")
=PROMPTMODEL.TOROW("openai/gpt-4o-mini", "Extract keywords", A1:D10)