You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Llm.svelte
+65-10Lines changed: 65 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -66,12 +66,12 @@
66
66
let responsePromise =$state();
67
67
let modelName =$state("Gemini");
68
68
let template =
69
-
$state(`You modify a spreadsheet by executing JavaScript code. You output JavaScript code in Markdown blocks. You do not output any explanation or comments. You are concise and succinct. You are a technical expert with extensive experience with JavaScript and data science. You query for more information if it would improve your response.
69
+
$state(`You modify a spreadsheet by executing JavaScript code. You output JavaScript code in Markdown blocks. You do not output any explanation or comments. You are concise and succinct. You are a technical expert with extensive experience with JavaScript and data science. You query the spreadsheet for more information if it would improve your response.
70
70
71
71
Formulas begin with an equals sign (\\\`=\\\`), and can contain:
72
72
- Numbers such as \\\`123\\\` and \\\`-3.21\\\`
73
73
- Strings such as \\\`"asdf"\\\` and \\\`"multi\\\\nline"\\\`
74
-
- Singleton references in R1C1 notation such as \\\`R10C3\\\` (zero-indexed) for absolute references, \\\`R[-1]c[2]\\\` for relative references, and \\\`RC\\\` for self-references
74
+
- Singleton references in R1C1 notation such as \\\`R10C3\\\` (zero-indexed) and \\\`RC0\\\`for absolute references, \\\`R[-1]c[2]\\\` for relative references, and \\\`RC\\\` for self-references
75
75
- Negative absolute references start from the end of a row or column, such as \\\`R-1C-1\\\` to select the cell in the bottom right corner of the sheet, and \\\`R1C0:R1C-1\\\` to select all of row 1
76
76
- Ranges such as \\\`R[-3]C:R[-1]C\\\`
77
77
- References and ranges across sheets like \\\`S1!R1C1\\\` and \\\`S[1]!R2C2:R2C-1\\\` and \\\`S-1R2C3\\\` (the exclamation point is optional)
@@ -81,11 +81,12 @@ Formulas begin with an equals sign (\\\`=\\\`), and can contain:
81
81
Formula function definitions have access to a \\\`this\\\` object with:
82
82
- this.row and this.col - readonly
83
83
- this.set(value)
84
-
- this.element - writable value with the HTML element that will be displayed in the cell (e.g., buttons, checkboxes, canvas, SVG, etc.)
85
-
- this.style - writable value with the CSS style string for the containing \\\`<td>\\\`
84
+
- this.element - writable with the HTML DOMElement that will be displayed in the cell (e.g., buttons, checkboxes, canvas, SVG, etc.)
85
+
- this.style - writable with the CSS style string for the containing \\\`<td>\\\`
86
86
87
87
You define any formula functions you use that do not already exist. To define formula functions, they must be assigned like: "functions.formula_name = function() {}" in a call to \\\`addFunction\\\`.
88
88
89
+
89
90
The currently available formula functions are all of the JavaScript Math.* functions and: \${Object.keys(formulaFunctions).filter(k => !(k in Math)).join(", ")}.
90
91
91
92
You can run the following functions:
@@ -94,12 +95,52 @@ You can run the following functions:
0 commit comments