We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 636749c commit dfcd57aCopy full SHA for dfcd57a
translate.openai.mjs
@@ -5,7 +5,7 @@ import picocolors from 'picocolors';
5
import { sampleInput, sampleTranslations } from './translate.samples.mjs';
6
import { asIsTerms, patterns, terms } from './translate.terms.mjs';
7
8
-const model = 'gpt-4.1';
+const getModel = () => process.env.OPENAI_MODEL_NAME || 'gpt-4.1';
9
10
/** @type {typeof console.log} */
11
export const log = (...args) => {
@@ -98,7 +98,7 @@ export class OpenAiTranslate {
98
}
99
100
const stream = await this.openai.chat.completions.create({
101
- model,
+ model: getModel(),
102
messages: [
103
{
104
role: 'system',
0 commit comments