From 56a77396bbefee6503edfd9d4b7273f400b5dd80 Mon Sep 17 00:00:00 2001 From: willy Date: Wed, 4 Sep 2024 16:00:56 +0900 Subject: [PATCH] feat: fix gitignore --- .../src/review/prompt/constructPrompt/constructPrompt.ts | 6 +++++- packages/code-review-gpt/src/review/prompt/prompts.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/code-review-gpt/src/review/prompt/constructPrompt/constructPrompt.ts b/packages/code-review-gpt/src/review/prompt/constructPrompt/constructPrompt.ts index 0e70f93..6854ad5 100644 --- a/packages/code-review-gpt/src/review/prompt/constructPrompt/constructPrompt.ts +++ b/packages/code-review-gpt/src/review/prompt/constructPrompt/constructPrompt.ts @@ -38,8 +38,12 @@ export const constructPromptsArray = ( getLanguageName(files[0].fileName) //assume the first file is representative of the language ); + const answerLanguage = process.env.LANGUAGE + ? `, Answer me in ${process.env.LANGUAGE},` + : ''; + const prompts = promptPayloads.map((payload) => { - return languageToInstructionPrompt + JSON.stringify(payload); + return languageToInstructionPrompt + JSON.stringify(payload) + answerLanguage; }); return prompts; diff --git a/packages/code-review-gpt/src/review/prompt/prompts.ts b/packages/code-review-gpt/src/review/prompt/prompts.ts index 4d91570..d7bc9f4 100644 --- a/packages/code-review-gpt/src/review/prompt/prompts.ts +++ b/packages/code-review-gpt/src/review/prompt/prompts.ts @@ -29,7 +29,7 @@ Format the response in a valid JSON format as a list of feedbacks, where the val } } -The filenames and file contents to review are provided below as a list of JSON objects, Answer me in Korean: +The filenames and file contents to review are provided below as a list of JSON objects: `;