gristlabs_grist-core/sandbox/grist
George Gevoian 94eec5e906 (core) Add AI Assistant retry with shorter prompt
Summary:
If the longer OpenAI model exceeds the OpenAPI context length, we now perform another retry with a
shorter variant of the formula prompt. The shorter prompt excludes non-referenced tables and lookup
method definitions, which should help reduce token usage in documents with larger schemas.

Test Plan: Server test.

Reviewers: JakubSerafin

Reviewed By: JakubSerafin

Subscribers: JakubSerafin

Differential Revision: https://phab.getgrist.com/D4184
2024-02-12 11:06:52 -05:00
..
functions Make ISEMAIL and ISURL more flexible for longer TLD (#834) 2024-01-31 13:58:50 -05:00
imports (core) Improve encoding detection for csv imports, and make encoding an editable option. 2023-08-24 09:50:52 -04:00
acl_formula.py
acl.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
action_obj.py
action_summary.py
actions.py
attribute_recorder.py (core) Allow assistant to evaluate current formula 2023-07-24 21:59:00 +02:00
autocomplete_context.py (core) Make Python tests pass in Python 3.11 2023-07-28 16:37:38 +02:00
codebuilder.py (core) Fix updating attributes inside f-strings when columns are renamed 2023-09-11 14:41:30 +02:00
column.py (core) Fix bug in data engine when records are added after clearing a table with ReplaceTableData. 2024-02-05 12:22:14 -05:00
csv_patch.py
depend.py
docactions.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
docmodel.py (core) Record Cards 2023-11-19 20:12:37 -05:00
engine.py (core) Avoid quadratic time complexity in fetch_table with query 2023-11-03 13:24:05 +02:00
fake_std_streams.py
formula_prompt.py (core) Add AI Assistant retry with shorter prompt 2024-02-12 11:06:52 -05:00
friendly_errors.py (core) Upgrade friendly-traceback and its dependencies 2022-10-28 14:44:14 +02:00
gencode.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
grist.py
identifiers.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
import_actions.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
lookup.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
main.py (core) Add AI Assistant retry with shorter prompt 2024-02-12 11:06:52 -05:00
match_counter.py
migrations.py (core) add initial support for special shares 2024-01-04 05:57:38 -05:00
moment.py (core) Cache converting timestamp to date 2024-01-08 10:50:50 +02:00
objtypes.py
parse_data.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
records.py
relabeling.py
relation.py
runtests.py
sandbox.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
schema.py (core) add initial support for special shares 2024-01-04 05:57:38 -05:00
sort_specs.py
summary.py (core) Record Cards 2023-11-19 20:12:37 -05:00
table_data_set.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
table.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
test_acl_formula.py
test_acl_renames.py
test_actions.py
test_codebuilder.py Skip tests involving f-strings for Python 3.9 (#669) 2023-09-11 18:49:30 +02:00
test_column_actions.py (core) Record Cards 2023-11-19 20:12:37 -05:00
test_completion.py (core) add initial support for special shares 2024-01-04 05:57:38 -05:00
test_default_formulas.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
test_depend.py
test_derived.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
test_display_cols.py (core) Record Cards 2023-11-19 20:12:37 -05:00
test_docmodel.py (core) Record Cards 2023-11-19 20:12:37 -05:00
test_engine.py (core) Avoid quadratic time complexity in fetch_table with query 2023-11-03 13:24:05 +02:00
test_find_col.py
test_formula_error.py
test_formula_prompt.py Skip tests involving f-strings for Python 3.9 (#669) 2023-09-11 18:49:30 +02:00
test_formula_undo.py
test_functions.py
test_gencode.py (core) Make Python tests pass in Python 3.11 2023-07-28 16:37:38 +02:00
test_import_actions.py (core) Record Cards 2023-11-19 20:12:37 -05:00
test_lookups.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
test_match_counter.py
test_migrations.py
test_moment.py
test_record_func.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
test_recordlist.py
test_reflist_rel.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
test_relabeling.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
test_renames2.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
test_renames.py (core) add initial support for special shares 2024-01-04 05:57:38 -05:00
test_replace_table_data.py (core) Fix bug in data engine when records are added after clearing a table with ReplaceTableData. 2024-02-05 12:22:14 -05:00
test_replay.py
test_requests.py REQUEST with unknown and undetectable encoding (#600) 2023-08-02 16:49:37 -04:00
test_rules_grid.py
test_rules.py
test_side_effects.py (core) Ensure formulas return something and don't assign to attributes of rec 2022-05-23 21:06:18 +02:00
test_sort_spec.py
test_summary2.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
test_summary_choicelist.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
test_summary_undo.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
test_summary.py (core) Fix error in sandbox when removing multiple summary source columns 2023-09-27 16:23:49 +02:00
test_table_actions.py (core) Record Cards 2023-11-19 20:12:37 -05:00
test_table_data_set.py
test_temp_rowids.py
test_textbuilder.py
test_treeview.py
test_trigger_formulas.py (core) add initial support for special shares 2024-01-04 05:57:38 -05:00
test_twowaymap.py
test_types.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
test_undo.py
test_urllib_patch.py
test_user.py (core) add initial support for special shares 2024-01-04 05:57:38 -05:00
test_useractions.py (core) Polish Record Cards 2024-01-30 13:25:50 -05:00
testsamples.py
testscript.json (core) Polish Record Cards 2024-01-30 13:25:50 -05:00
testutil.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
textbuilder.py
treeview.py
twowaymap.py
tzdata.data
urllib_patch.py
user.py (core) add initial support for special shares 2024-01-04 05:57:38 -05:00
useractions.py (core) Polish Record Cards 2024-01-30 13:25:50 -05:00
usercode.py (core) Make Python tests pass in Python 3.11 2023-07-28 16:37:38 +02:00
usertypes.py (core) Update logging in sandbox code, and log tracebacks as single log messages. 2023-07-18 11:21:25 -04:00
xmlrunner.py