TASK_MODELS

Knowledgebase

TASK_MODELS

Function Overview

TASK_MODELS is a custom function that creates a dropdown menu of all available language models in your specified cell. It streamlines model selection and minimizes typographical errors by allowing users to pick from a curated list of models provided by various API providers. This dropdown also displays your recently used models for quick access.

Uses

  1. Create a model selection dropdown that can be referenced in other Sheet Workflows functions such as

    LM

    .
  2. Enable switching between different AI models without needing to remember exact model names.
  3. Set up worksheets where non-technical users can select from a curated list of models.
  4. Build templates with predefined model selection cells.
  5. Combine with other Sheet Workflows functions that require model specification.
  6. Maintain a consistent user interface for model selection across workflows.

Syntax and Parameters

=TASK_MODELS(cell_address)

Parameter Data Type Required Description
cell_address

string

Optional The cell where you want the dropdown to appear. For example,

"B2"

. If not specified, the dropdown will be created in the cell immediately to the right of the formula cell.

Advanced Options

Cell Address Specification

  • Provide a specific cell address by using a quoted reference (e.g.,

    "B5"

    ) to place the dropdown in that exact cell.
  • Use a column-only reference (e.g.,

    "C"

    ) to place the dropdown in that column on the same row as the function.
  • Omit the parameter to have the dropdown created in the cell immediately to the right of where the formula is entered.

Working With the Model Selection

The dropdown created by TASK_MODELS can be referenced in other Sheet Workflows functions such as

LM

. For example, if you create a model dropdown in cell B2, you can reference it like this:

=LM("Write a short poem about clouds", B2)

This allows you to change the model without modifying your formula.

Examples

Example 1: Basic Usage

Enter the following in cell A1:

=TASK_MODELS()

After clicking the "Run" button in the Sheet Workflows sidebar, a dropdown list will appear in the cell to the right (B1) with all available models.

Example 2: Specific Cell Placement

Enter the following in cell A1:

=TASK_MODELS("D5")

After clicking the "Run" button, a dropdown list will appear in cell D5. You can then reference D5 in your other workflow functions to use the selected model.

Example 3: Creating a Workflow Template

  1. In cell A1, add a label: "Selected Model:".

  2. In cell A2, enter the formula:

       =TASK_MODELS("B1")

  3. In cell A3, add a label: "Prompt:".

  4. In cell B3, enter your prompt text.

  5. In cell A4, add a label: "Result:".

  6. In cell B4, enter the formula:

       =LM(B3, B1)

  7. Run the TASK_MODELS function to create the dropdown.

  8. Users can now select different models without editing the formulas.

Best Practices

  • Place model selection at the top of your workflow for easy access.
  • Label your model dropdown clearly to indicate its purpose.
  • Use cell references for model names instead of hardcoding them.
  • Consider creating a dedicated models sheet for complex workflows.
  • Update your API providers regularly to keep the model list current.
  • Always click the "Run" button in the Sheet Workflows sidebar after entering the formula.

Troubleshooting

No Models Appear

Ensure you have configured at least one API provider with a valid API key in the Sheet Workflows settings.

Run Button Does Nothing

Select the cell containing the TASK_MODELS formula before clicking the "Run" button in the sidebar.

Model Not Found

Verify that the appropriate provider is configured in your Sheet Workflows settings.

Formula Displays as Text

After entering the formula, click the "Run" button in the Sheet Workflows sidebar to activate the dropdown.

Invalid Cell Address Error

Make sure the cell address is formatted correctly with quotation marks (e.g.,

"B2"

).

Check the cell_address parameter to ensure it is correctly formatted.

Recently Used Models Do Not Show

Use a model with the

LM

function first; only then will it appear in the list of recently used models.

FAQ

How Do I Add More Models To The Dropdown?

The dropdown displays models based on the API providers configured in the Sheet Workflows settings. To add more models, open the sidebar, navigate to "Settings" or "Configuration," and add additional providers such as OpenAI, Anthropic, or Gemini. Run TASK_MODELS again to update the dropdown.

Can I Customize Which Models Appear In The Dropdown?

The function automatically includes all models from your configured providers. To change which models appear, adjust the API providers in your Sheet Workflows settings.

How Does The Recently Used Models Section Work?

When you use a model with the

LM

function, Sheet Workflows stores it in your recent models list. The next time you run TASK_MODELS, up to 10 of your most recently used models will appear at the top of the dropdown.

Can I Use The Model Dropdown Across Multiple Sheets?

Yes, but you need to create the dropdown on each sheet where you want to use it. Dropdowns cannot be directly referenced across different sheets.

What’s The Difference Between The Model Providers?

Different providers offer models with unique capabilities, costs, and specializations. The provider name (e.g., "OpenAI/gpt-4") is shown before the model name to distinguish between them.

Why Do I Need To Click "Run" Instead Of Seeing The Dropdown Immediately?

Custom functions that modify the spreadsheet need to be executed via the sidebar to comply with the Google Sheets security model. Clicking "Run" activates these functions.

Can I Programmatically Set The Default Selected Model?

Yes, if a default model is configured in the Sheet Workflows settings, it will be automatically set as the initially selected value in the dropdown.

elisha

5 months ago

Categories
Features