๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
728x90

AI ์ฝ”๋“œ ๋ฆฌ๋ทฐ1

ChatGPT(OpenAI) ๋ฅผ ํ™œ์šฉํ•œ Code Review ๊ฐœ์š” ์ด ๋ฌธ์„œ๋Š” OpenAI๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ฝ”๋“œ ๋ฆฌ๋ทฐ ๋„๊ตฌ๋ฅผ ๊ฐœ๋ฐœํ•˜๋Š” ๊ณผ์ •์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋„๊ตฌ๋Š” ์ฃผ์–ด์ง„ ์ฝ”๋“œ์— ๋Œ€ํ•œ ์ž๋™ํ™”๋œ ๋ฆฌ๋ทฐ์™€ ํ”ผ๋“œ๋ฐฑ์„ ์ƒ์„ฑํ•˜์—ฌ ๊ฐœ๋ฐœ์ž์˜ ์ƒ์‚ฐ์„ฑ์„ ํ–ฅ์ƒ์‹œํ‚ค๋Š” ๋ฐ ๋ชฉ์ ์ด ์žˆ์Šต๋‹ˆ๋‹ค. 1. ์ฝ”๋“œ ๋ฆฌ๋ทฐ ๋„๊ตฌ ์†Œ๊ฐœ ์ด ์ฝ”๋“œ ๋ฆฌ๋ทฐ ๋„๊ตฌ๋Š” OpenAI์˜ GPT-3.5๋ฅผ ํ™œ์šฉํ•˜์—ฌ ์ฝ”๋“œ์— ๋Œ€ํ•œ ๋ฆฌ๋ทฐ์™€ ํ”ผ๋“œ๋ฐฑ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๋Š” ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•˜๊ณ  ํ”„๋กฌํ”„ํŠธ๋ฅผ ํ†ตํ•ด ๋ฆฌ๋ทฐ๋ฅผ ์š”์ฒญํ•˜๋ฉด, OpenAI ๋ชจ๋ธ์ด ํ•ด๋‹น ์ฝ”๋“œ์— ๋Œ€ํ•œ ๋ฆฌ๋ทฐ๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. 2. ์ฃผ์š” ๊ตฌ์„ฑ ์š”์†Œ openai.js // openai.js require('dotenv').config(); const OpenAI = require('openai'); const fs = require('fs'); // Get the file path .. 2024. 2. 6.