Skip to content

Commit 2f8fbe9

Browse files
committed
chore: add completion adapter for the translations resource
1 parent 0157cd1 commit 2f8fbe9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

dev-demo/resources/translations.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
import CompletionAdapterOpenAIChatGPT from "../../adapters/adminforth-completion-adapter-open-ai-chat-gpt/index.js";
23
import AdminForth, { AdminForthDataTypes, AdminForthResourceInput } from "../../adminforth/index.js";
34
import I18nPlugin from "../../plugins/adminforth-i18n/index.js";
45
import { randomUUID } from 'crypto';
@@ -35,6 +36,11 @@ export default {
3536
// optional field store list of completed translations
3637
// will hel to filter out incomplete translations
3738
completedFieldName: 'completedLangs',
39+
completeAdapter: new CompletionAdapterOpenAIChatGPT({
40+
openAiApiKey: process.env.OPENAI_API_KEY as string,
41+
model: 'gpt-5-mini',
42+
}),
43+
// translateLangAsBCP47Code: {sr: 'sr-Cyrl'},
3844
}),
3945

4046
],

0 commit comments

Comments
 (0)