Skip to content

Commit 5b1be38

Browse files
committed
docs(tex-complete): add initialPrompt description
1 parent 9cf3cd9 commit 5b1be38

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

adminforth/documentation/docs/tutorial/05-Plugins/06-text-complete.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,28 @@ export const admin = new AdminForth({
8888
Here is how it looks:
8989

9090
!![alt text](dashboard_test2.gif)
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+
new TextCompletePlugin({
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

Comments
 (0)