File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -119,9 +119,15 @@ export default class TextCompletePlugin extends AdminForthPlugin {
119
119
"Don't talk to me. Just write text. No quotes. Don't repeat current field value, just write completion\n" ;
120
120
121
121
} else {
122
- content = `Fill text/string field "${ this . options . fieldName } " in the table "${ resLabel } "\n` +
123
- ( Object . keys ( recordNoField ) . length > 0 ? `Record has values for the context: ${ inputContext } \n` : '' ) +
124
- "Be short, clear and precise. No quotes. Don't talk to me. Just write text\n" ;
122
+
123
+ if ( this . options . initialPrompt ) {
124
+ content = `${ this . options . initialPrompt } \n` +
125
+ "No quotes. Don't talk to me. Just write text\n" ;
126
+ } else {
127
+ content = `Fill text/string field "${ this . options . fieldName } " in the table "${ resLabel } "\n` +
128
+ ( Object . keys ( recordNoField ) . length > 0 ? `Record has values for the context: ${ inputContext } \n` : '' ) +
129
+ "Be short, clear and precise. No quotes. Don't talk to me. Just write text\n" ;
130
+ }
125
131
}
126
132
127
133
process . env . HEAVY_DEBUG && console . log ( '🪲 OpenAI Prompt 🧠' , content ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,16 @@ export interface PluginOptions {
6
6
*/
7
7
fieldName : string ;
8
8
9
+
10
+ /**
11
+ * Initial prompt request when field is empty. Mustache syntax for record context fields is supported.
12
+ * E.g.
13
+ * 'I need to introduce "{{ name }}" technology to my software development company website, I need short but very attractive description if it.'
14
+ *
15
+ * Where `name` is a field name which contains technology name e.g. Vue.js
16
+ */
17
+ initialPrompt ?: string ;
18
+
9
19
/**
10
20
* Expert settings
11
21
*/
@@ -21,6 +31,7 @@ export interface PluginOptions {
21
31
*/
22
32
debounceTime ?: number ;
23
33
34
+
24
35
/**
25
36
* When completion is made, this plugin passes non-empty fields of the record to the LLM model for record context understanding.
26
37
*/
You can’t perform that action at this time.
0 commit comments