Skip to content

Commit a034f6e

Browse files
author
yaroslav8765
committed
fix: update resource label usage in content generation
1 parent e5b70b9 commit a034f6e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,13 @@ export default class TextCompletePlugin extends AdminForthPlugin {
108108
currentVal = currentVal.slice(-promptLimit);
109109
}
110110

111-
// const resLabel = this.resourceConfig.label;
112111
const fieldLabel = this.resourceConfig?.columns.find(c => c.name === this.options.fieldName)?.label || this.options.fieldName;
113-
const resourceLabel = this.resourceConfig?.label || this.resourceConfig?.resourceId;
112+
const resLabel = this.resourceConfig!.label;
114113

115114
let content;
116115

117116
if (currentVal) {
118-
content = `Continue writing for text/string field "${fieldLabel}" in the table "${resourceLabel}"\n` +
117+
content = `Continue writing for text/string field "${fieldLabel}" in the table "${resLabel}"\n` +
119118
(Object.keys(recordNoField).length > 0 ? `Record has values for the context: ${inputContext}\n` : '') +
120119
`Current field value: ${currentVal}\n` +
121120
"Don't talk to me. Just write text. No quotes. Don't repeat current field value, just write completion\n";
@@ -134,7 +133,7 @@ export default class TextCompletePlugin extends AdminForthPlugin {
134133
content = `${interpretedPrompt}\n` +
135134
"No quotes. Don't talk to me. Just write text\n";
136135
} else {
137-
content = `Fill text/string field "${fieldLabel}" in the table "${resourceLabel}"\n` +
136+
content = `Fill text/string field "${fieldLabel}" in the table "${resLabel}"\n` +
138137
(Object.keys(recordNoField).length > 0 ? `Record has values for the context: ${inputContext}\n` : '') +
139138
"Be short, clear and precise. No quotes. Don't talk to me. Just write text\n";
140139
}

0 commit comments

Comments
 (0)