aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.tsx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.tsx
index 890bc6f73..d47ae802c 100644
--- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.tsx
+++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.tsx
@@ -17,6 +17,18 @@ export class TemplateManager {
return initializedTemplates;
}
+ /**
+ * Provides a text summary of content currently filled into a template, formatted for GPT analysis.
+ * @param template the template to be summarized
+ */
+ getContentSummary = (template: Template) => {
+ let summary: string = '';
+ template.contentFields.forEach(field => {
+ summary += `--- Field #${field.getID} (title: ${field.getTitle()}): ${field.getContent() ?? ''} ---`;
+ });
+ return summary;
+ }
+
getValidTemplates = (cols: Col[]): Template[] => {
return this.templates.filter(template => template.isValidTemplate(cols));
}