Skip to content

Commit 18ccf24

Browse files
author
yaroslav8765
committed
fix: update label handling in content generation for text fields
1 parent 4334f33 commit 18ccf24

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,19 @@ export default class RichEditorPlugin extends AdminForthPlugin {
300300
currentVal = currentVal.slice(-promptLimit);
301301
}
302302

303-
const resLabel = this.resourceConfig?.label;
304-
303+
const resLabel = this.resourceConfig!.label;
304+
const fieldLabel = this.options?.htmlFieldName;
305+
305306
let content;
306307

307308
if (currentVal) {
308-
content = `Continue writing for text/string field "${this.options.htmlFieldName}"${resLabel ? " in the table " + resLabel : ""} \n` +
309+
content = `Continue writing for text/string field "${fieldLabel}" in the table "${resLabel}"\n` +
309310
(Object.keys(recordNoField).length > 0 ? `Record has values for the context: ${inputContext}\n` : '') +
310311
`Current field value: ${currentVal}\n` +
311312
"Don't talk to me. Just write text. No quotes. Don't repeat current field value, just write completion\n";
312313

313314
} else {
314-
content = `Fill text/string field "${this.options.htmlFieldName}"${resLabel ? " in the table " + resLabel : ""}\n` +
315+
content = `Fill text/string field "${fieldLabel}" in the table "${resLabel}"\n` +
315316
(Object.keys(recordNoField).length > 0 ? `Record has values for the context: ${inputContext}\n` : '') +
316317
"Be short, clear and precise. No quotes. Don't talk to me. Just write text\n";
317318
}

0 commit comments

Comments
 (0)