From 39cacf45ff8c5b479050ef887c02163089c15d73 Mon Sep 17 00:00:00 2001 From: Darcy Ye Date: Sun, 31 Mar 2024 16:15:19 +0800 Subject: [PATCH] chore(cli): update translate CLI configs --- packages/cli/src/commands/translate/openai.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/translate/openai.ts b/packages/cli/src/commands/translate/openai.ts index 551465d45..26e30efb2 100644 --- a/packages/cli/src/commands/translate/openai.ts +++ b/packages/cli/src/commands/translate/openai.ts @@ -14,7 +14,7 @@ export const createOpenaiApi = () => { const proxy = getProxy(); return got.extend({ - prefixUrl: 'https://api.openai.com/v1', + prefixUrl: process.env.OPENAI_API_PROXY_ENDPOINT ?? 'https://api.openai.com/v1', headers: { Authorization: `Bearer ${process.env.OPENAI_API_KEY ?? ''}`, }, @@ -50,7 +50,8 @@ export const translate = async ({ api .post('chat/completions', { json: { - model: 'gpt-3.5-turbo-1106', + // The full list of OPENAI model can be found at https://platform.openai.com/docs/models. + model: process.env.OPENAI_MODEL_NAME ?? 'gpt-3.5-turbo-0125', messages: getTranslationPromptMessages({ sourceFileContent, targetLanguage,