-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AI 코드리뷰 추가 #47
AI 코드리뷰 추가 #47
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Code Review | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
test: | ||
# if: ${{ contains(github.event.*.labels.*.name, 'gpt review') }} # Optional; to run only when a label is attached | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: anc95/ChatGPT-CodeReview@main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
# Optional | ||
LANGUAGE: Korean | ||
OPENAI_API_ENDPOINT: https://api.openai.com/v1 | ||
MODEL: gpt-4o-mini # https://platform.openai.com/docs/models | ||
PROMPT: 다음 코드에서 오류가 있는지 검토하고 개선 사항이 있다면 diff 형식으로 제안해줘. 이때 제안하는 코드블록은 전체코드가 아닌 개선이 필요한 부분만 포함해야해. 리뷰를 할 때 주요 사항과 개선 제안 사항을 간단하게 설명하고 코드 오류를 검토해줘. 개선사항이 어떤 형식인지는 알려주지 않아도 좋아. | ||
top_p: 1 # https://platform.openai.com/docs/api-reference/chat/create#chat/create-top_p | ||
temperature: 1 # https://platform.openai.com/docs/api-reference/chat/create#chat/create-temperature | ||
max_tokens: 10000 | ||
MAX_PATCH_LENGTH: 10000 # if the patch/diff length is large than MAX_PATCH_LENGTH, will be ignored and won't review. By default, with no MAX_PATCH_LENGTH set, there is also no limit for the patch/diff length. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 다음은 코드에서 발견된 문제와 개선 사항을 제안하는 diff 형식입니다. @@ -18,7 +18,7 @@
MODEL: gpt-4o-mini # https://platform.openai.com/docs/models
PROMPT: 다음 코드에서 오류가 있는지 검토하고 개선 사항을 diff 형식으로 제안해줘. 이때 제안하는 코드블록은 전체코드가 아닌 개선이 필요한 부분만 포함해야해.
- max_tokens: 10000
+ max_tokens: 5000 # API 요청의 토큰 수를 줄여 응답 시간을 단축하고 실패 가능성을 감소시킴
MAX_PATCH_LENGTH: 10000 # if the patch/diff length is large than MAX_PATCH_LENGTH, will be ignored and won't review. By default, with no MAX_PATCH_LENGTH set, there is also no limit for the patch/diff length.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 주어진 YAML 코드에서 몇 가지 개선 사항과 오류를 검토한 결과는 다음과 같습니다. 주요 사항
개선 제안 사항 (diff 형식)15c15
< MODEL: gpt-4o-mini # https://platform.openai.com/docs/models
---
> MODEL: gpt-4-turbo # 올바른 모델 이름으로 수정
19,20c19
< max_tokens: 10000
< MAX_PATCH_LENGTH: 10000 # if the patch/diff length is large than MAX_PATCH_LENGTH, will be ignored and won't review. By default, with no MAX_PATCH_LENGTH set, there is also no limit for the patch/diff length.
---
> max_tokens: 5000 # 최대 토큰 수를 줄임
> MAX_PATCH_LENGTH: 2000 # 패치 크기를 제한으로 조정 이러한 변경사항은 정확성을 높이고, 코드의 기능을 더욱 확실히 하기 위해 제안되었습니다. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 검토한 결과, 코드에서 몇 가지 개선이 필요한 부분과 잠재적인 오류가 있습니다. 주로 구성 파일의 가독성 및 보안 관련 사항을 다루겠습니다. 주요 사항:
아래는 수정 제안입니다. @@ -12,7 +12,7 @@
- MODEL: gpt-4o-mini # https://platform.openai.com/docs/models
+ MODEL: gpt-4-davinci # 공식 모델 이름으로 수정
@@ -14,8 +14,7 @@
- # Optional
+ LANGUAGE: Korean # 언어 설정은 필수이며, 주석 제거
- MAX_PATCH_LENGTH: 10000 # if the patch/diff length is large than MAX_PATCH_LENGTH, will be ignored and won't review. By default, with no MAX_PATCH_LENGTH set, there is also no limit for the patch/diff length.
+ MAX_PATCH_LENGTH: 3000 # 일반적인 설정으로 수정 이러한 개선을 통해 코드를 보다 안전하고 효율적으로 유지할 수 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 코드 패치는 GitHub Actions를 이용해 코드 리뷰를 자동화하는 설정입니다. 다음은 코드 리뷰의 주요 사항과 개선 제안입니다:
버그 위험:
MODEL
에 지정된gpt-4o-mini
가 정확한 모델 이름인지 확인 필요합니다. 오타 또는 잘못된 설정일 수 있습니다.PROMPT
가 비어있습니다. 실제 리뷰 요청을 위한 적절한 프롬프트 메시지가 필요합니다.개선 제안:
MAX_PATCH_LENGTH
와 같은 설정 값을 추가할 때 기본값을 명시하고 문서화하면 더 좋습니다. 이를 통해 사용자들이 설정의 의미를 이해하기 쉬워집니다.temperature
와 같은 파라미터는 다양한 실험을 통해 최적 값을 찾는 것이 바람직합니다. 초기값이 적절한지 검토하십시오.if
조건문 주석 처리된 부분을 필요한 경우 활성화할 수 있도록 명확한 설명을 추가하세요.기타 주의사항:
max_tokens
수치를 매우 높게 설정했습니다 (10,000). API 제한이나 응답 시간을 고려할 필요가 있습니다.OPENAI_API_ENDPOINT
는 대개 기본값으로 사용되므로, 이 설정이 꼭 필요한지 확인해보세요.이러한 포인트들을 참고하여 코드의 안정성을 높이고 효율적인 자동화 프로세스를 구축하시기 바랍니다.