vscode copilot git commit 生成效果太差,用其他模型替换

问题

众所周知,copilot git commit 就像在随机生成

git commit 这种较为复杂的内容还是交给大模型做比较合适

方法

刚好,gitlens 最近开发了 AI commit的功能,其提供配置url + api可以实现自定义模型

gitlens 只有3种模型可用:

然而这些都由于网络问题不能直接用

解决方法

我们替换 openai 的 api url

我们可以用close ai,其相当于等效替代:https://referer.shadowai.xyz/r/20560

如何修改

在 user setting中加入:

json 复制代码
"gitlens.ai.experimental.openai.url": "https://api.openai-proxy.org/v1/chat/completions",

方法论

你可能看到 close ai官方提供的文档上是:

和上面的"gitlens.ai.experimental.openai.url": "https://api.openai-proxy.org/v1/chat/completions"不一样,我是为什么要填这个长的呢?

首先,填短的肯定是用不了,这个我试过。

但是我是怎么知道要填后面的这么长一串的呢?

其实,这个就看个人的思考能力了。

我是通过查看默认的openai的api url接口得到的:

在 vscode 的 output 中可以看到

解决问题的思路比解决问题本身更重要

相关推荐
智慧地球(AI·Earth)1 小时前
Codex配置问题解析:wire_api格式不匹配导致的“Reconnecting...”循环
开发语言·人工智能·vscode·codex·claude code
markvivv4 小时前
在 Kylin Linux Advanced Server for Kunpeng V10 上构建 VSCode 1.106
linux·vscode·kylin
zhangfeng11334 小时前
Kiro python环境的设置 中文语言包设置,通用vscode ,因为kiro是vscode基础上做的
开发语言·vscode·python
微醺的老虎6 小时前
【工具】vscode格式化json文件
ide·vscode·编辑器
bigHead-6 小时前
Git合并操作详解:安全高效地合并远程分支
git·安全·elasticsearch
C_心欲无痕6 小时前
ts - 交叉类型
前端·git·typescript
乔宕一6 小时前
vscode 设置每次调试 powershell 脚本都使用临时的 powershell 终端
ide·vscode·编辑器
唐装鼠7 小时前
linux vscode解压版 AI账号无法登陆问题(浏览器无法打开vscode)
linux·运维·vscode
秋饼8 小时前
【K8S测试程序--git地址】
git·容器·kubernetes
KevinShi_BJ8 小时前
Github Copilot 实践
github·copilot