From 2ae1ad590387a3da4247d538f88c9acd9aba3909 Mon Sep 17 00:00:00 2001 From: Aurelien Franky Date: Thu, 23 Nov 2023 22:09:28 +0100 Subject: [PATCH] improvements to the checklist node --- .../src/adapters/document_check/document_check.ts | 14 +++++++------- .../src/adapters/document_check/document_check.ts | 6 ++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/@pufflig/ps-nodes-config/src/adapters/document_check/document_check.ts b/packages/@pufflig/ps-nodes-config/src/adapters/document_check/document_check.ts index 8c02a1a..b6cbf9c 100644 --- a/packages/@pufflig/ps-nodes-config/src/adapters/document_check/document_check.ts +++ b/packages/@pufflig/ps-nodes-config/src/adapters/document_check/document_check.ts @@ -64,6 +64,13 @@ export const documentCheck: NodeConfig = { editableSchema: true, defaultValue: [], }, + { + id: "fields", + name: "Fields", + description: "Custom fields to include in the output for each checklist item", + type: "list", + defaultValue: ["ok (yes/no)"], + }, { id: "format", name: "Format", @@ -75,12 +82,5 @@ export const documentCheck: NodeConfig = { { id: "markdown", name: "Markdown" }, ], }, - { - id: "fields", - name: "Fields", - description: "Custom fields to include in the output for each checklist item", - type: "list", - defaultValue: ["ok"], - }, ], }; diff --git a/packages/@pufflig/ps-nodes/src/adapters/document_check/document_check.ts b/packages/@pufflig/ps-nodes/src/adapters/document_check/document_check.ts index 8fc1041..b3bba1e 100644 --- a/packages/@pufflig/ps-nodes/src/adapters/document_check/document_check.ts +++ b/packages/@pufflig/ps-nodes/src/adapters/document_check/document_check.ts @@ -68,6 +68,8 @@ export const execute: Execute = async ( // TODO: move into the API const instructionsWithChecklist = `${instructions} +DOCUMENT: +{{document}} CHECKLIST DESCRIPTION: ${description} @@ -75,8 +77,8 @@ ${description} CHECKLIST FORMAT: {{table}} -CHECKLIST IN ${format.toUpperCase()} FORMAT: -`; +Return only the CHECKLIST IN ${format.toUpperCase()} FORMAT: +${isCSV ? "check," : "|check|"}`; // render the prompt without overwriting the document and table variables const renderedPrompt = Mustache.render(instructionsWithChecklist, {