Blog

发布于 更新于

AI总结: 本文介绍了如何在网站上集成猫动画效果,具体通过引入oneko.js脚本并配置其路径。此外,还提到在GitHub上设置AI总结所需的变量信息,包括API_URL、API_KEY和API_MODEL,并指明API_KEY的创建方式以及Models权限的设置要求。改进建议是确保在设置API_KEY时,遵循GitHub的最新安全措施,并在文档中详细说明权限设置的步骤,以避免用户在使用时遇到权限错误。

网站上放置猫

https://github.com/adryd325/oneko.js

Image

引入js, 默认取脚本目录下oneko.gif, 因为相对路径配置有些页面有问题, 所以调整js直接配置完整路径

<script src="{{ blogBase['homeUrl'] }}/assets/oneko.js/oneko.js" data-cat="{{ blogBase['homeUrl'] }}/assets/oneko.js/oneko.gif"></script>  

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"}}