Skip to content

Commit 850a60b

Browse files
committed
fix: update live-demo dependencies and integrate TextComplete plugin in apartments resource
1 parent ca4d009 commit 850a60b

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

live-demo/app/package-lock.json

Lines changed: 12 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

live-demo/app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
"@adminforth/i18n": "^1.2.4",
2525
"@adminforth/import-export": "^1.3.1",
2626
"@adminforth/rich-editor": "^1.2.2",
27+
"@adminforth/text-complete": "^1.4.4",
2728
"@adminforth/two-factors-auth": "^1.1.2",
2829
"@adminforth/upload": "^1.4.1",
2930
"@prisma/client": "^6.6.0",
30-
"adminforth": "^2.1.0-next.14",
31+
"adminforth": "^2.3.1",
3132
"better-sqlite3": "^10.0.0",
3233
"express": "^4.19.2"
3334
},

live-demo/app/resources/apartments.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { AdminForthDataTypes } from 'adminforth';
22
import importExport from '@adminforth/import-export';
33
import RichEditorPlugin from '@adminforth/rich-editor';
4-
import ChatGptPlugin from '@adminforth/chat-gpt';
4+
import TextCompletePlugin from '@adminforth/text-complete';
55
import UploadPlugin from '@adminforth/upload';
66
import { randomUUID } from 'crypto';
77
import CompletionAdapterOpenAIChatGPT from "@adminforth/completion-adapter-open-ai-chat-gpt";
@@ -167,9 +167,16 @@ export default {
167167
}
168168
}
169169
}),
170-
new ChatGptPlugin({
171-
openAiApiKey: process.env.OPENAI_API_KEY as string,
170+
new TextCompletePlugin({
172171
fieldName: 'title',
172+
adapter: new CompletionAdapterOpenAIChatGPT({
173+
openAiApiKey: process.env.OPENAI_API_KEY as string,
174+
}),
175+
// expert: {
176+
// maxTokens: 50, // token limit to generate for each completion. 50 is default
177+
// promptInputLimit: 500, // Limit in characters of edited field to be passed to Model. 500 is default value
178+
// debounceTime: 300, // Debounce time in milliseconds. 300 is default value
179+
// }
173180
}),
174181
new UploadPlugin({
175182
pathColumnName: 'apartment_image',

0 commit comments

Comments
 (0)