Skip to content

Commit 296a0ec

Browse files
committed
Improve changelog generation.
1 parent 8599968 commit 296a0ec

File tree

2 files changed

+30
-37
lines changed

2 files changed

+30
-37
lines changed

docs/CHANGES.md

Lines changed: 27 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tasks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ def update_changelog(ctx: Context, version: str | None = None, dry_run: bool = F
182182

183183
client = OpenAI(api_key=os.environ["OPENAPI_KEY"])
184184

185-
messages = [{"role": "user", "content": f"summarize, include authors: '{body}'"}]
185+
messages = [{"role": "user", "content": f"summarize as a markdown numbered list, include authors: '{body}'"}]
186186
chat = client.chat.completions.create(model="gpt-4o", messages=messages)
187187

188188
reply = chat.choices[0].message.content
189-
body = "\n".join(reply.split("\n")[1:])
190-
body = body.strip()
189+
body = "\n".join(reply.split("\n")[1:-1])
190+
body = body.strip().strip("`")
191191
print(f"ChatGPT Summary of Changes:\n{body}")
192192

193193
except BaseException as ex:

0 commit comments

Comments
 (0)