diff options
author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-10-29 16:25:30 -0400 |
---|---|---|
committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-10-29 16:25:30 -0400 |
commit | 58e97fd9a8c85c7e4df75aed17d914498680c190 (patch) | |
tree | dc3fcb51ea351000c894ae0e36f6de06e6d660d5 /src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.tsx | |
parent | 691fc130de706c691a42f7e87688c14102016ccc (diff) |
no compile errors but probably 100 logical ones
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.tsx')
-rw-r--r-- | src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.tsx | 12 |
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)); } |