Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions docs/api-reference/functions/prompt-model.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
title: 'PROMPTMODEL'
---

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

## Arguments

<ParamField body="providerAndModel" type="string" required>
A string on the form "provider/model" (e.g., "openai/gpt-4o-mini").

The default model is determined by your configuration settings.
</ParamField>

<ParamField body="instructions" type="string" required>
Your prompt - the instructions for the model to follow.

Can be a string, a cell reference, or a range of cells.
</ParamField>

<ParamField body="cellsOrTemperature" type="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.
</ParamField>

<ParamField body="temperature" type="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.
</ParamField>

## Returns

<ResponseField name="response" type="string">
The model's response as plain text.
</ResponseField>

<RequestExample>

```excel Text Instructions
=PROMPTMODEL("openai/gpt-4o-mini", "Extract keywords")
```

```excel Cell Instructions
=PROMPTMODEL("openai/gpt-4o-mini", A1:D10)
```

```excel With Context
=PROMPTMODEL("openai/gpt-4o-mini", "Extract keywords", A1:D10)
```

```excel With Temperature
=PROMPTMODEL("openai/gpt-4o-mini", "Extract keywords", A1:D10, 0.7)
```

</RequestExample>

<ResponseExample>

```excel TOROW
=PROMPTMODEL.TOROW("openai/gpt-4o-mini", "Extract keywords", A1:D10)
```

```excel TOCOLUMN
=PROMPTMODEL.TOCOLUMN("openai/gpt-4o-mini", "Extract keywords", A1:D10)
```

```excel TORANGE
=PROMPTMODEL.TORANGE("openai/gpt-4o-mini", "Extract keywords", A1:D10)
```

</ResponseExample>
28 changes: 0 additions & 28 deletions docs/api-reference/functions/prompt-with.mdx

This file was deleted.

88 changes: 67 additions & 21 deletions docs/api-reference/functions/prompt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,72 @@
title: 'PROMPT'
---

```excel
PROMPT(cells: range | instruction: string, [instruction: range or string | temperature: double], [temperature: double]): string
Allows you to call the default model from a cell formula.

## Inputs

<ParamField body="instructions" type="string" required>
Your prompt - the instructions for the model to follow.

Can be a string, a cell reference, or a range of cells.
</ParamField>

<ParamField body="cellsOrTemperature" type="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.
</ParamField>

<ParamField body="temperature" type="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.
</ParamField>

<ResponseField name="response" type="string">
The model's response as plain text.
</ResponseField>

<RequestExample>

```excel Text Instructions
=PROMPT("Extract keywords")
```

```excel Cell Instructions
=PROMPT(A1:D10)
```

```excel With Context
=PROMPT("Extract keywords", A1:D10)
```

```excel With Temperature
=PROMPT("Extract keywords", A1:D10, 0.7)
```

</RequestExample>

<ResponseExample>

```excel TOROW
=PROMPT.TOROW("Extract keywords", A1:D10)
```

```excel TOCOLUMN
=PROMPT.TOCOLUMN("Extract keywords", A1:D10)
```

```excel TORANGE
=PROMPT.TORANGE("Extract keywords", A1:D10)
```

Allows you to call a model from a cell formula.

- **cells (Required):** A cell or a range of cells.
- The model will use the cells as context and follow any instructions as long as they are present _somewhere_ in the cells. If you provide an instruction as second argument, the second argument instructions takes precedence.
- **instructions (Optional):** A cell, a range of cells, or a string.
- The model will follow these instructions and ignore instructions in the cells of the first argument.
- Default: Empty.
- **temperature (Optional):** double.
- A value between 0 and 1 that controls the balance between deterministic outputs and creative exploration. Lower values make the output more deterministic, higher values make it more random.
- Default: 0. The model will almost always give you the same result.
- **Returns:** string.
- The AI model's response.

Example usage:

- `=PROMPT(A1:D10, "Extract keywords")` will use the selected range of cells as context and follow the instruction to extract keywords.
- `=PROMPT(A1:D10, "Extract keywords", 0.7)` will use the selected range of cells as context, follow the instruction to extract keywords, and use a temperature of 0.7.
- `=PROMPT(A1:D10)` will use the range of cells as context and follow instructions as long as they present _somewhere_ in the cells.
- `=PROMPT(A1:D10, 0.7)` will use the selected range of cells as context, follow any instruction within the cells, and use a temperature of 0.7.
</ResponseExample>
44 changes: 36 additions & 8 deletions docs/api-reference/tools/file-reader.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,42 @@ title: 'File Reader'

Reads a file and returns its content as plain text.

```csharp
FileReader(filePath: string)
## Parameters

<ParamField body="filePath" type="string" required>
An absolute path to a file on your disk.

````mdx Example path
C:\Users\username\Documents\report.pdf
````

Supports extensions: c, cpp, cs, csv, cxx, h, hxx, html, java, json, jsonl, md, pdf, php, py, rb, txt, and xml.
</ParamField>

## Returns

<ResponseField name="content" type="string">
The content of the file as plain text.
</ResponseField>

<Info>
This tool is automatically used by the AI model when needed. You enable it in Cellm's ribbon menu, then simply ask the model to perform tasks that require reading files (e.g., "Summarize the content of report.pdf in my Documents folder").
</Info>

<RequestExample>

```excel Read and summarize
=PROMPT("Read and summarize C:\Users\username\Documents\report.pdf")
```

</RequestExample>

<ResponseExample>

```excel With cell reference
=PROMPT("Read and summarize this file", A1)
```

- **filePath (Required):** A path to a file on your disk.
- Supports extensions c, cpp, cs, csv, cxx, h, hxx, html, java, json, jsonl, md, pdf, php, py, rb, txt, and xml.
- **Returns:** The content of the file as plain text.
Where A1 contains: `C:\Users\username\Documents\report.pdf`

<Warning>
You cannot call this function yourself, but you can instruct the model to call it for you.
</Warning>
</ResponseExample>
66 changes: 52 additions & 14 deletions docs/api-reference/tools/file-search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,58 @@
title: 'File Search'
---

Uses glob patterns to search for files on the your disk and returns matching file paths.
Uses glob patterns to search for files on your disk and returns matching file paths.

```csharp
FileReader(rootPath: string, includePatterns: [string], [excludePatterns: [string]])
## Parameters

<ParamField body="rootPath" type="string" required>
The root directory to start the glob search from. Example: `C:\Users\username\Documents`
</ParamField>

<ParamField body="includePatterns" type="string[]" required>
Patterns to match files you want to find. Use absolute paths with wildcards. Common examples:
- `C:\Users\username\Documents\*.pdf` - All PDF files in Documents
- `C:\Users\username\Downloads\*.xlsx` - All Excel files in Downloads
- `C:\Projects\**\report*.docx` - Word files starting with "report" in Projects and all subfolders
- `C:\Data\2024-*.csv` - CSV files starting with "2024-" in Data folder
</ParamField>

<ParamField body="excludePatterns" type="string[]">
Patterns to exclude files from results. Use absolute paths with wildcards. Common examples:
- `C:\Users\username\Documents\*temp*` - Exclude files with "temp" in the name
- `C:\Users\username\Documents\*.bak` - Exclude backup files
- `C:\Projects\**\.git\**` - Exclude files in .git folders
- `C:\Users\username\Documents\*draft*` - Exclude files with "draft" in the name
</ParamField>

## Returns

<ResponseField name="filePaths" type="string[]">
A list of file paths that match the include patterns and don't match the exclude patterns.
</ResponseField>

<Info>
This tool is automatically used by the AI model when needed. You enable it in Cellm's ribbon menu, then simply ask the model to perform tasks that require file operations (e.g., "Find all PDF files in my Documents folder").
</Info>

<RequestExample>

```excel Find PDF files
=PROMPT("Find all PDF files in C:\Users\username\Documents")
```

- **rootPath (Required):** A string.
- The root directory to start the glob search from.
- **includePatterns (Required):** List of strings.
- The list of glob patterns whose matches will be included in the result.
- **excludePatterns (Optional):** List of strings.
- A list of glob patterns whose matches will be excluded from the result.
- Default: Empty.

<Warning>
You cannot call this function yourself, but you can instruct the model to call it for you.
</Warning>
```excel Find CSV files excluding temporary
=PROMPT("Find all CSV files in C:\Users\username\Downloads, but exclude any files with 'temp' or 'draft' in the name")
```

</RequestExample>

<ResponseExample>

```excel With cell reference
=PROMPT("Find all PDF files in this folder", A1)
```

Where A1 contains: `C:\Users\username\Documents`

</ResponseExample>
8 changes: 5 additions & 3 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@
{
"group": "Usage",
"pages": [
"usage/prompting",
"usage/function-calling"
"usage/writing-prompts",
"usage/calling-functions",
"usage/using-mcp"
]
},
{
"group": "Models",
"pages": [
"models/choosing-model",
"models/local-models",
"models/hosted-models"
]
Expand All @@ -45,7 +47,7 @@
"group": "Functions",
"pages": [
"api-reference/functions/prompt",
"api-reference/functions/prompt-with"
"api-reference/functions/prompt-model"
]
},
{
Expand Down
Loading
Loading