Skip to content

Commit

Permalink
🔧 generate_pr_description.pyのデフォルト設定とプロンプト構造の改善 (#19)
Browse files Browse the repository at this point in the history
* Feature: Update prompt structure in generate_pr_description.py to ensure emoji usage for clarity

* Feature: Ensure temperature input defaults to 0.7 in generate_pr_description.py
  • Loading branch information
tqer39 authored Nov 3, 2024
1 parent 51e03c1 commit 7a9ed9b
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions scripts/generate_pr_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,6 @@ def create_prompt(commit_logs: str) -> str:
- なければ項目ごと出力しない。
- 嘘を書かない。
- 処理内容の図解が必要であれば mermaid.js の記法を使用する。
- 以下の項目に分けて記述する。
## 📒 変更点の概要
1. 各項目の先頭に適切な emoji を付ける。
## ⚒ 技術的な詳細
1. 各項目の先頭に適切な emoji を付ける。
## ⚠ 注意点
1. 各項目の先頭に適切な emoji を付ける。
## コミットログとファイルの差分
Expand All @@ -70,14 +57,17 @@ def create_prompt(commit_logs: str) -> str:
プルリクエストのタイトル
## 📓 変更点の概要
## 📒 変更点の概要
1. 各項目の先頭に適切な emoji を付ける。
## ⚒ 技術的な詳細
- 概要を簡潔に説明する
1. 各項目の先頭に適切な emoji を付ける
## ⚒ 技術的な詳細や注意点
## ⚠ 注意点
- 詳細な説明A
- 詳細な説明B
1. 各項目の先頭に適切な emoji を付ける。
"""


Expand All @@ -92,7 +82,7 @@ def generate_pr_description(commit_logs: str) -> str:
{"role": "user", "content": prompt},
],
max_tokens=1000,
temperature=decimal(os.getenv("TEMPERATURE")),
temperature=decimal.Decimal(os.getenv("TEMPERATURE") or 0.7),
)

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

0 comments on commit 7a9ed9b

Please sign in to comment.