Skip to content

Commit beb7f82

Browse files
zlcnjuJounQinautofix-ci[bot]
authored
feat: add AZURE_OPENAI_MODEL env support (#112)
Co-authored-by: JounQin <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 23cd09a commit beb7f82

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/twelve-mugs-accept.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@alauda/doom": patch
3+
---
4+
5+
feat: add `AZURE_OPENAI_MODEL` env support

src/cli/translate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ The text for translation is provided below, within triple quotes:
115115
`.trim()
116116

117117
let openai: AzureOpenAI | undefined
118+
const openaiModel = process.env.AZURE_OPENAI_MODEL || 'gpt-4.1-mini'
118119

119120
export interface InternalTranslateOptions extends TranslateOptions {
120121
source: Language
@@ -367,7 +368,7 @@ export const translate = async ({
367368
content: contentWithPlaceholders,
368369
},
369370
],
370-
model: 'gpt-4.1-mini',
371+
model: openaiModel,
371372
temperature: 0.2,
372373
})
373374

0 commit comments

Comments
 (0)