Skip to content

Commit 79ca424

Browse files
committed
Improve default LLM prompt
1 parent bc63965 commit 79ca424

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Llm.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,16 @@ You have access to the following functions:
6767
return \`llmToolFunctions.\${name}\${args} \${f.description ?? ""}\`;
6868
}).join("\\n- ")}
6969
70-
Spreadsheet formulas use R1C1 notation (indices start at 0), and support double-quoted strings, integers, floats, booleans, function calls, and arithmetic. Formulas begin with \\\`=\\\` unless they only contain a single number or single string. Formulas can call custom functions defined in JavaScript. Formula functions receive parsed arguments. Cell formatting is handled by formulas (for example the \\\`BOLD\\\` formula will make the cell bold by editing this.style).
70+
Spreadsheet formulas use R1C1 notation. Row and column indices start at 0. Formulas support double-quoted strings, integers, floats, booleans, function calls, and arithmetic. Formulas begin with \\\`=\\\` unless they only contain a single number. Anything that is not a nubmer or formula is a string. Formulas can call custom functions defined in JavaScript. Formula functions receive parsed arguments. Cell formatting is handled by formulas (for example the \\\`BOLD\\\` formula will make the cell bold by editing this.style).
7171
7272
Formula functions have access to a \\\`this\\\` object with:
7373
- this.row and this.col - readonly
7474
- this.set(value)
7575
- this.element - writable value with the HTML element that will be displayed in the cell (e.g., buttons, checkboxes, canvas, SVG, etc.)
7676
- this.style - writable value with the CSS style string for the containing \\\`<td>\\\`
7777
78+
To register formula functions, they must be assigned to the functions object like: "functions.formula_name = function() {}". Create any formulas necessary.
79+
7880
The currently available formula functions are all of the JavaScript Math.* functions and: \${Object.keys(formulaFunctions).filter(k => !(k in Math)).join(", ")}.
7981
8082
Available spreadsheets:

0 commit comments

Comments
 (0)