Skip to content

Commit

Permalink
Feature/v0.0.17 alpha 20241103 (#21)
Browse files Browse the repository at this point in the history
* Feature: Replace decimal.Decimal with float for temperature input in generate_pr_description.py

* Feature: Update generate-pr-description-action to v0.0.16-alpha and specify model as "gpt-4o"
  • Loading branch information
tqer39 authored Nov 3, 2024
1 parent 7a9ed9b commit f40fdff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/generate-pr-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: tqer39/[email protected].13-alpha
- uses: tqer39/[email protected].16-alpha
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
model: "gpt-4o"
3 changes: 1 addition & 2 deletions scripts/generate_pr_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# "openai",
# ]
# ///
import decimal
from openai import OpenAI
import os
import subprocess
Expand Down Expand Up @@ -82,7 +81,7 @@ def generate_pr_description(commit_logs: str) -> str:
{"role": "user", "content": prompt},
],
max_tokens=1000,
temperature=decimal.Decimal(os.getenv("TEMPERATURE") or 0.7),
temperature=float(os.getenv("TEMPERATURE", "0.7")),
)

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

0 comments on commit f40fdff

Please sign in to comment.