Skip to content

Commit 4920ce8

Browse files
committed
fix: add CompletionAdapterOpenAIChatGPT to RichEditorPlugin
1 parent 3b3e411 commit 4920ce8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

live-demo/app/resources/apartments.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import RichEditorPlugin from '@adminforth/rich-editor';
44
import ChatGptPlugin from '@adminforth/chat-gpt';
55
import UploadPlugin from '@adminforth/upload';
66
import { randomUUID } from 'crypto';
7+
import CompletionAdapterOpenAIChatGPT from "@adminforth/completion-adapter-open-ai-chat-gpt";
78

89

910
const blockDemoUsers = async ({ record, adminUser, resource }) => {
@@ -149,6 +150,13 @@ export default {
149150
new RichEditorPlugin({
150151
htmlFieldName: 'description',
151152
completion: {
153+
adapter: new CompletionAdapterOpenAIChatGPT({
154+
openAiApiKey: process.env.OPENAI_API_KEY as string,
155+
model: 'gpt-4o', // default "gpt-4o-mini"
156+
expert: {
157+
temperature: 0.7 //Model temperature, default 0.7
158+
}
159+
}),
152160
provider: 'openai-chat-gpt',
153161
params: {
154162
apiKey: process.env.OPENAI_API_KEY as string,

0 commit comments

Comments
 (0)