You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/05-Plugins/06-text-complete.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,3 +88,28 @@ export const admin = new AdminForth({
88
88
Here is how it looks:
89
89
90
90
!
91
+
92
+
93
+
## Initial prompt
94
+
95
+
96
+
If you want to generate field by your own prompt, you can use `initialPrompt` property in plugin configuration.
97
+
98
+
```ts title="./resources/apartments.ts"
99
+
newTextCompletePlugin({
100
+
fieldName: 'description',
101
+
//diff-add
102
+
initialPrompt: `I need to introduce apartment '{{title}}' to people who have a pets and afraid that apartment is not pet friendly. I need short but very attractive description if it. It should have CTAs and Emojis. write \n\n once you are done.`,
103
+
//diff-add
104
+
expert: {
105
+
//diff-add
106
+
stop: ['\n\n'],
107
+
//diff-add
108
+
maxTokens: 500,
109
+
//diff-add
110
+
},
111
+
}),
112
+
```
113
+
114
+
> **Note:**`{{title}}` is a placeholder for the value of the field `title`. It will be replaced with the actual value of the field when generating the prompt. You can use any field name from your resource configuration.
115
+
> **Note:**`stop` is a property of the model that tells it when to stop generating text. In this case, we are telling it to stop when it sees `\n\n`.
0 commit comments