Skip to content

Commit

Permalink
Feature/v0.0.18 alpha 20241103 (#23)
Browse files Browse the repository at this point in the history
* 🔧 generate-pr-description.ymlのpull-requests権限設定を修正

* 🔧 generate-pr-description.ymlの条件文を修正

* 🔧 generate_pr_description.pyの温度設定を0.7から0.1に変更

* 🔧 openai-modelの名称を統一し、関連する環境変数を修正
  • Loading branch information
tqer39 authored Nov 3, 2024
1 parent f40fdff commit 934cd8f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/generate-pr-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
pull-requests: write
pull-requests: write # uses: tqer39/generate-pr-description-action
if: contains(github.event.pull_request.user.login, 'renovate') == false
steps:
- uses: actions/checkout@v4
Expand All @@ -24,4 +24,4 @@
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
model: "gpt-4o"
openai-model: "gpt-4o"
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ inputs:
required: true
default: ""
# see https://platform.openai.com/docs/models#continuous-model-upgrades
model:
description: 'Model'
openai-model:
description: 'OpenAI Model'
required: true
default: 'gpt-3.5-turbo'
# https://platform.openai.com/docs/api-reference/audio/createTranscription
Expand Down Expand Up @@ -55,7 +55,7 @@ runs:
- name: Generate PR Title and Description
env:
OPENAI_API_KEY: ${{ inputs.openai-api-key }}
MODEL: ${{ inputs.model }}
OPENAI_MODEL: ${{ inputs.openai-model }}
TEMPERATURE: ${{ inputs.temperature }}
COMMIT_LOG_HISTORY_LIMIT: ${{ inputs.commit-log-history-limit }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate_pr_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ def generate_pr_description(commit_logs: str) -> str:
prompt = create_prompt(commit_logs)

response = client.chat.completions.create(
model=os.getenv("MODEL"),
model=os.getenv("OPENAI_MODEL"),
messages=[
{"role": "system", "content": "あなたは優秀なソフトウェアエンジニアです。"},
{"role": "user", "content": prompt},
],
max_tokens=1000,
temperature=float(os.getenv("TEMPERATURE", "0.7")),
temperature=float(os.getenv("TEMPERATURE", "0.1")),
)

return str(response.choices[0].message.content).strip()
Expand Down

0 comments on commit 934cd8f

Please sign in to comment.