Skip to content

Commit 5ba08c6

Browse files
committed
chore: read model name from env
1 parent 636749c commit 5ba08c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

translate.openai.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import picocolors from 'picocolors';
55
import { sampleInput, sampleTranslations } from './translate.samples.mjs';
66
import { asIsTerms, patterns, terms } from './translate.terms.mjs';
77

8-
const model = 'gpt-4.1';
8+
const getModel = () => process.env.OPENAI_MODEL_NAME || 'gpt-4.1';
99

1010
/** @type {typeof console.log} */
1111
export const log = (...args) => {
@@ -98,7 +98,7 @@ export class OpenAiTranslate {
9898
}
9999

100100
const stream = await this.openai.chat.completions.create({
101-
model,
101+
model: getModel(),
102102
messages: [
103103
{
104104
role: 'system',

0 commit comments

Comments
 (0)