0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

chore(cli): update translate CLI configs

This commit is contained in:
Darcy Ye 2024-03-31 16:15:19 +08:00
parent ceeeeb07a3
commit 39cacf45ff
No known key found for this signature in database
GPG key ID: B46F4C07EDEFC610

View file

@ -14,7 +14,7 @@ export const createOpenaiApi = () => {
const proxy = getProxy(); const proxy = getProxy();
return got.extend({ return got.extend({
prefixUrl: 'https://api.openai.com/v1', prefixUrl: process.env.OPENAI_API_PROXY_ENDPOINT ?? 'https://api.openai.com/v1',
headers: { headers: {
Authorization: `Bearer ${process.env.OPENAI_API_KEY ?? ''}`, Authorization: `Bearer ${process.env.OPENAI_API_KEY ?? ''}`,
}, },
@ -50,7 +50,8 @@ export const translate = async ({
api api
.post('chat/completions', { .post('chat/completions', {
json: { 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({ messages: getTranslationPromptMessages({
sourceFileContent, sourceFileContent,
targetLanguage, targetLanguage,