Skip to content

Commit 000b770

Browse files
committed
dev-demo: add complete adapter for the thranslations resource only if there is opnen_api_key
1 parent e4d078b commit 000b770

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

dev-demo/resources/translations.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,16 @@ export default {
3636
// optional field store list of completed translations
3737
// will hel to filter out incomplete translations
3838
completedFieldName: 'completedLangs',
39-
completeAdapter: new CompletionAdapterOpenAIChatGPT({
40-
openAiApiKey: process.env.OPENAI_API_KEY as string,
41-
model: 'gpt-5-mini',
42-
}),
39+
...(process.env.OPENAI_API_KEY ?
40+
{
41+
completeAdapter: new CompletionAdapterOpenAIChatGPT({
42+
openAiApiKey: process.env.OPENAI_API_KEY as string,
43+
model: 'gpt-5-mini',
44+
}),
45+
// translateLangAsBCP47Code: {sr: 'sr-Cyrl'},
46+
parallelTranslationLimit: 1
47+
}
48+
: {}),
4349
// translateLangAsBCP47Code: {sr: 'sr-Cyrl'},
4450
parallelTranslationLimit: 1
4551
}),

0 commit comments

Comments
 (0)