Skip to content

๐Ÿฆ… LLM์„ ์ด์šฉํ•œ ์ฝ”๋”ฉ ํ…Œ์ŠคํŠธ์šฉ ์ฝ”๋“œ๋ฆฌ๋ทฐ Github Action bot

License

Notifications You must be signed in to change notification settings

SukJinKim/Boramae-reviews-algorithm

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

77 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


๐Ÿค” : "๋งŽ์€ ์‚ฌ๋žŒ๋“ค์ด ์ฝ”ํ…Œ๋ฅผ ๋Œ€๋น„ํ•ด์„œ ํ‘ผ ์ฝ”๋“œ๋“ค์„ ๋‹จ์ˆœํžˆ github์— push๋งŒ ํ•˜๊ณ  ์žˆ๋Š”๋ฐ, ๊ธฐ์™•์ด๋ฉด ์ฝ”๋“œ๋ฆฌ๋ทฐ๊นŒ์ง€ ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค๋ฉด ์–ด๋–จ๊นŒ?"


1. Introduction

Boramae-reviews-algorithm (์ดํ•˜ B.R.A.)์€ LLM์„ ์ด์šฉํ•˜์—ฌ ์ฝ”ํ…Œ์šฉ ์ฝ”๋“œ๋ฅผ ๋ฆฌ๋ทฐํ•˜๋Š” bot์ž…๋‹ˆ๋‹ค.
B.R.A.๋Š” ์ •๋‹ต ์ฝ”๋“œ์— ๋Œ€ํ•ด ๊ฐ€๋…์„ฑ๊ณผ ์„ฑ๋Šฅ ๋ฉด์—์„œ ์ตœ์ ํ™”๋œ ์ฝ”๋“œ๋ฅผ ์ œ์•ˆํ•  ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ, ์˜ค๋‹ต ์ฝ”๋“œ์— ๋Œ€ํ•ด์„œ๋„ ์ •๋‹ต ์ฝ”๋“œ๋กœ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐœ์„  ๋ฐฉ์•ˆ์„ ์ œ์‹œํ•ฉ๋‹ˆ๋‹ค.
๋งŒ์•ฝ ๋‹น์‹ ์ด ์•„๋ž˜ ๊ฐ ํ˜ธ์— ํ•˜๋‚˜๋ผ๋„ ํ•ด๋‹นํ•˜๋ฉด, ์ €ํฌ๊ฐ€ ๋งŒ๋“  bot์ด ๋ถ„๋ช… ๋„์›€์ด ๋  ๊ฒƒ์ด๋ผ ํ™•์‹ ํ•ฉ๋‹ˆ๋‹ค.

  • ์ทจ์—… ์ค€๋น„ ๋“ฑ์œผ๋กœ ์ฝ”ํ…Œ๋ฅผ ์ค€๋น„ํ•˜๊ณ  ์žˆ๋‹ค.
  • ์ฝ”ํ…Œ๋ฅผ ๋Œ€๋น„ํ•˜์—ฌ ํ‘ผ ์ฝ”๋“œ๋“ค์„ ๋‹จ์ˆœํžˆ Github์— push๋งŒ ํ•˜๊ณ  ์žˆ๋‹ค.
  • '๋ถ„๋ช… ๋‚ด๊ฐ€ ์ œ์ถœํ•œ ์ฝ”๋“œ๊ฐ€ ๋งž์•˜๋Š”๋ฐ ์™œ ํ‹€๋ ธ์ง€?'๋ผ๊ณ  ์ƒ๊ฐํ•ด์„œ ๋‹ค๋ฅธ ์‚ฌ๋žŒ์˜ ๋ธ”๋กœ๊ทธ๋ฅผ ์ฐธ๊ณ ํ–ˆ์œผ๋‚˜, ์„ค๋ช…์ด ์ดํ•ด๋˜์ง€ ์•Š์•„ ์•„์‰ฌ์› ๋˜ ๊ฒฝํ—˜์ด ์žˆ๋‹ค.
  • ์ฝ”ํ…Œ์—์„œ ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด ๊ฐ€๋…์„ฑ์ด ์ข‹์€ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๊ณ  ์‹ถ๋‹ค.

2. Key features

B.R.A์˜ ์ฃผ์š” ๊ธฐ๋Šฅ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • ๋ฌธ์ œ ๋ถ„์„ (ํ•ต์‹ฌ ์š”๊ตฌ์‚ฌํ•ญ, ์ตœ์ ํ™”๋œ ์ฝ”๋“œ์—์„œ ์‚ฌ์šฉํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜/์ž๋ฃŒ๊ตฌ์กฐ ์„ค๋ช…)
  • ์ตœ์ ํ™”๋œ ์ฝ”๋“œ ์ œ์‹œ
  • ๊ธฐ์กด ์ฝ”๋“œ์™€ ๋น„๊ต์‹œ ๋ณ€๊ฒฝ์‚ฌํ•ญ ์„ค๋ช… (๋ณ€๊ฒฝ ์‚ฌํ•ญ์— ๋Œ€ํ•œ ์ด์œ ์™€ ๊ฐœ์„ ์  ๋“ฑ)
  • ์„ฑ๋Šฅ ๋ถ„์„ (์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋น„๊ต)

3. Supported Environments

ํ˜„์žฌ B.R.A.๊ฐ€ ์ง€์›ํ•˜๊ณ  ์žˆ๋Š” ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ฌธ์ œ ํ”Œ๋žซํผ, ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด ๊ทธ๋ฆฌ๊ณ  LLM API ์ œ๊ณต์—…์ฒด๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  1. ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ฌธ์ œ ํ”Œ๋žซํผ : ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค, ์•Œ๊ณ ์ŠคํŒŸ

Warning

BOJ์˜ ๊ฒฝ์šฐ ํ”Œ๋žซํผ ์ •์ฑ…์ƒ ๋ฌธ์ œ๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์—†์–ด ์ง€์›์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

  1. ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด : C, C++, Java, Python
  2. LLM API ์ œ๊ณต์—…์ฒด : OpenAI, Anthropic

Note

B.R.A.๋Š” ๊ฐ ์—…์ฒด๋ณ„ ์ตœ์‹  LLM์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
๋ฒ„์ „๋ณ„ LLM ์ •๋ณด๋Š” ์•„๋ž˜๋ฅผ ์ฐธ๊ณ ํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

๋ฒ„์ „๋ณ„ LLM ์ •๋ณด

v1

์—…์ฒด๋ช… ๋ชจ๋ธ๋ช…
OpenAI gpt-4o
Anthropic claude-3-5-sonnet-20240620

4. How to use

  1. Prerequisites
    B.R.A.๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์•„๋ž˜ 2๊ฐ€์ง€๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

    1. ์ฝ”ํ…Œ์— ์ œ์ถœํ•œ ์ฝ”๋“œ๋ฅผ ์ €์žฅํ•  github repositroy ์ƒ์„ฑ
    2. LLM API ํ‚ค ๋ฐœ๊ธ‰

Important

์‚ฌ์šฉ์ž๋Š” ๋ฐ˜๋“œ์‹œ OpenAI ํ˜น์€ Anthropic์‚ฌ์˜ API ํ‚ค๋ฅผ ๋ฐœ๊ธ‰๋ฐ›์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค.


  1. Github secret ์„ค์ •
    B.R.A.๋Š” ๋ณด์•ˆ์„ ์œ„ํ•ด Github secret์— ์ €์žฅ๋œ ์‚ฌ์šฉ์ž API ํ‚ค๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
    ์ด๋ฅผ ์œ„ํ•ด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ ˆ์ฐจ๋ฅผ ๋”ฐ๋ผ์ฃผ์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค.

    1. B.R.A.๋ฅผ ์‹คํ–‰ํ•˜๊ณ  ์‹ถ์€ repo ํ™ˆํŽ˜์ด์ง€ ์ด๋™
    2. ์ƒ๋‹จ์˜ Settings ํด๋ฆญ
    3. Security > Secrets and variables ์•„๋ž˜ Actions ํด๋ฆญ
    4. New repository secret ํด๋ฆญ
    5. Name์€ API_KEY, Secret์€ ๋ฐœ๊ธ‰๋ฐ›์€ API ํ‚ค ๊ฐ’ ์ž…๋ ฅํ•œ ๋’ค Add secret ํด๋ฆญ


  1. workflow ์ƒ์„ฑ
    B.R.A. bot์„ ์‹คํ–‰ํ•˜๊ณ  ์‹ถ์€ repo์— .github/workflows/code_review.yml์„ ์•„๋ž˜์™€ ๊ฐ™์ด ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
    ์ด๋•Œ ์‚ฌ์šฉ์ž๋Š” ์›ํ•˜๋Š”๋Œ€๋กœ LLM API ์ œ๊ณต์—…์ฒด๋ช…(model_company)์™€ few-shot learning ์ ์šฉ์—ฌ๋ถ€(few_shot_learning)์„ customizeํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    ์ตœ์ ์˜ ์„ค์ •๊ฐ’์— ๋Œ€ํ•œ ์‹คํ—˜ ๊ฒฐ๊ณผ model_company : "ANTHROPIC", few_shot_learning: "true"๋กœ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์ด ๊ฐ€์žฅ ์„ฑ๋Šฅ์ด ์šฐ์ˆ˜ํ–ˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์‹คํ—˜ ๋ณด๊ณ ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

    name: Code Review
    
    permissions:
      contents: read
      pull-requests: write
    
    on:
      pull_request:
        types: [opened, synchronize]
        paths:
          - "**.c"
          - "**.cpp"
          - "**.java"
          - "**.py"
    
    jobs:
      code-review:
        runs-on: ubuntu-latest
        steps:
          - name: check out repository
            uses: actions/checkout@v4
    
          - name: ๐Ÿฆ… Boramae reviews algorithm
            uses: SukJinKim/Boramae-reviews-algorithm@v1
            with:
              github_token: ${{ secrets.GITHUB_TOKEN }}
              # "OPENAI", "ANTHROPIC" ๋‘˜ ์ค‘ ํ•˜๋‚˜ ์„ ํƒ
              model_company: "ANTHROPIC"
              api_key: ${{ secrets.API_KEY }}
              # Few shot learning ์ ์šฉ์„ ์›ํ•˜์ง€ ์•Š๋Š”๋‹ค๋ฉด ์•„๋ž˜ ์ฃผ์„ ์ฒ˜๋ฆฌ
              few_shot_learning: "true"

  1. Create/Update PR(Pull Request)

     flowchart LR;
     U[User] -- 1.Create/Update PR --> G[(Github repo)] -- 2.Trigger --> B([B.R.A.]);
     B -- 3.Review --> G;
    
    Loading
    • PR์„ createํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋งํฌ ์ฐธ๊ณ ํ•ด์ฃผ์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

    B.R.A.๋Š” ์‚ฌ์šฉ์ž๊ฐ€ Github repo์— PR์„ createํ•˜๊ฑฐ๋‚˜ updateํ•˜๋ฉด ์ž๋™์œผ๋กœ ๋™์ž‘ํ•˜์—ฌ ๋ฆฌ๋ทฐ๋ฅผ ๋‚จ๊น๋‹ˆ๋‹ค.
    ์ด๋•Œ ๋ฐ˜๋“œ์‹œ ์•„๋ž˜ ๋‘ ๊ฐ€์ง€ ์กฐ๊ฑด์„ ๋งŒ์กฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

    1. ํ•˜๋‚˜์˜ commit์—๋Š” ๋ฐ˜๋“œ์‹œ ํ•˜๋‚˜์˜ ์ œ์ถœ ์ฝ”๋“œ๋งŒ ์žˆ์–ด์•ผ ํ•œ๋‹ค.
    2. commit message์—๋Š” ๋ฐ˜๋“œ์‹œ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ฌธ์ œ URL์ด ํฌํ•จ๋˜์–ด์•ผ ํ•œ๋‹ค.

5. Shout out to NAVER D2 ๐Ÿ’š

NAVER D2 ์œ ํŠœ๋ธŒ ์˜์ƒ

B.R.A ํ”„๋กœ์ ํŠธ๋Š” NAVER D2์˜ ์‹œ๊ฐ„์€ ๊ธˆ์ด๋‹ค : LLM์„ ์ด์šฉํ•œ AI ์ฝ”๋“œ ๋ฆฌ๋ทฐ ๋„์ž…๊ธฐ๋กœ๋ถ€ํ„ฐ ์˜๊ฐ์„ ๋ฐ›์•˜์Šต๋‹ˆ๋‹ค!

About

๐Ÿฆ… LLM์„ ์ด์šฉํ•œ ์ฝ”๋”ฉ ํ…Œ์ŠคํŠธ์šฉ ์ฝ”๋“œ๋ฆฌ๋ทฐ Github Action bot

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages