发布于 更新于

AI总结: 本文介绍了在GitHub上设置AI总结所需的变量信息,包括API_URL、API_KEY和API_MODEL,并强调了API_KEY的创建步骤和Models权限的设置。未设置正确权限会导致访问错误。 优化建议:提供详细的步骤说明,确保用户能够顺利创建API_KEY并设置Models权限。同时,可以增加对错误信息的解释,以帮助用户理解如何解决问题。

AI总结

  1. AI总结需要在以下地址设置变量信息 https://github.com/anaer/blog/settings/secrets/actions

Image

API_URL = "https://models.inference.ai.azure.com/chat/completions"
API_KEY = "github_pat_xxxxxxx"
API_MODEL = "gpt-4o"
  1. API_KEY 需要在以下链接进行创建 https://github.com/settings/personal-access-tokens

GitHub Models key 需要设置Models权限为Read-only

Image

如果未设置权限 会报错

{"error":{"code":"unauthorized","message":"The `models` permission is required to access this endpoint","details":"The `models` permission is required to access this endpoint"}}