gristlabs_grist-core/app
Alex Hall 391c8ee087 (core) Allow assistant to evaluate current formula
Summary:
Replaces https://phab.getgrist.com/D3940, particularly to avoid doing potentially unwanted things automatically.

Adds optional fields `evaluateCurrentFormula?: boolean; rowId?: number` to `FormulaAssistanceContext` (part of `AssistanceRequest`). When `evaluateCurrentFormula` is `true`, calls a new function `evaluate_formula` in the sandbox which computes the existing formula in the column (regardless of anything the AI may have suggested) and uses that to generate an additional system message which is added before the user's message. In theory this could be used in an interface where users ask why a formula doesn't work, including possibly a formula suggested by the AI. For now, it's only used in `runCompletion_impl.ts` for experimenting.

Also cleaned up a bit, removing `_chatMode` which is always `true` now, and uses of `regenerate` which is always `false`.

Test Plan: Updated `runCompletion_impl` to optionally use the new feature, in which case it now scores 51/68 instead of 49/68.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3970
2023-07-24 21:59:00 +02:00
..
client (core) Update assistant link 2023-07-21 13:43:31 -04:00
common (core) Allow assistant to evaluate current formula 2023-07-24 21:59:00 +02:00
gen-server (core) deleting queue from single webhook 2023-07-18 11:46:10 +02:00
plugin Use relative imports only in plugin folder (#328) 2022-10-26 10:41:38 -04:00
server (core) Allow assistant to evaluate current formula 2023-07-24 21:59:00 +02:00
tsconfig.json (core) move home server into core 2020-07-21 20:39:10 -04:00