mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
allow AI Assistance to run against any chat-completion-style endpoint (#630)
This adds an ASSISTANT_CHAT_COMPLETION_ENDPOINT which can be used to enable AI Assistance instead of an OpenAI API key. The assistant then works against compatible endpoints, in the mechanical sense. Quality of course will depend on the model. I found some tweaks to the prompt that work well both for Llama-2 and for OpenAI's models, but I'm not including them here because they would conflict with some prompt changes that are already in the works. Co-authored-by: Alex Hall <alex.mojaki@gmail.com>
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
*
|
||||
* USAGE:
|
||||
* OPENAI_API_KEY=<my_openai_api_key> node core/test/formula-dataset/runCompletion.js
|
||||
* or
|
||||
* ASSISTANT_CHAT_COMPLETION_ENDPOINT=http.... node core/test/formula-dataset/runCompletion.js
|
||||
* (see Assistance.ts for more options).
|
||||
*
|
||||
* # WITH VERBOSE:
|
||||
* VERBOSE=1 OPENAI_API_KEY=<my_openai_api_key> node core/test/formula-dataset/runCompletion.js
|
||||
@@ -68,7 +71,8 @@ const SIMULATE_CONVERSATION = true;
|
||||
const FOLLOWUP_EVALUATE = false;
|
||||
|
||||
export async function runCompletion() {
|
||||
ActiveDocDeps.ACTIVEDOC_TIMEOUT = 600;
|
||||
// This could take a long time for LLMs running on underpowered hardware >:)
|
||||
ActiveDocDeps.ACTIVEDOC_TIMEOUT = 500000;
|
||||
|
||||
// if template directory not exists, make it
|
||||
if (!fs.existsSync(path.join(PATH_TO_DOC))) {
|
||||
|
||||
Reference in New Issue
Block a user