开始使用免费开始使用

用 AI 生成高质量提交信息

您现在要提交由 AI 生成的 docstring,以及一些小修复。由于您对模型在 docstring 生成上的表现很满意,您决定也用它来根据 git diff 中的代码更改生成有意义的提交信息。到目前为止,您写出了以下提示词:

Based on the following code diff, write a commit message:

🟥 -def is_valid_account_number(account: str) -> bool:
🟥 -  return account.isdigit()
🟩 +def is_valid_account_number(account: str) -> bool:
🟩 +  if not account.isdigit():
🟩 +    return False
🟩 +  if len(account) != 10:
🟩 +    return False
🟩 +  return True

为了更有效地引导模型,这个提示词还缺少什么关键信息?

本练习是课程的一部分

面向开发者的 AI 辅助编码

查看课程

动手互动练习

通过我们的互动练习之一,将理论转化为实践

开始练习