按照这个方法修改的话,在今天的最新版插件里还是能用的吗?
我这边今天能正常使用,按照教程修改,没碰到什么问题
{
"bind": "127.0.0.1:8181",
"proxy_url": "",
"timeout": 600,
"codex_api_base": "https://api.xiaoai.plus/v1",
"codex_api_key": "sk-mYJn",
"codex_api_organization": "",
"codex_api_project": "",
"code_instruct_model": "gpt-3.5-turbo-instruct",
"chat_api_base": "https://api.xiaoai.plus/v1",
"chat_api_key": "sk-mYJn",
"chat_api_organization": "",
"chat_api_project": "",
"chat_max_tokens": 4096,
"chat_model_default": "gpt-4o",
"chat_model_map": {},
"chat_locale": "zh_CN",
"auth_token": ""
}
还有
"github.copilot.advanced": {
"debug.overrideCAPIUrl": "http://127.0.0.1:8181",
"debug.overrideProxyUrl": "http://127.0.0.1:8181",
"debug.chatOverrideProxyUrl": "http://127.0.0.1:8181/v1/chat/completions",
"authProvider": "github-enterprise"
},
"github-enterprise.uri": "https://cocopilot.org",
func (s *ProxyService) InitRoutes(e *gin.Engine) {
e.GET("/_ping", s.pong)
e.GET("/models", s.models)
authToken := s.cfg.AuthToken // replace with your dynamic value as needed
if authToken != "" {
// 鉴权
v1 := e.Group("/:token/", AuthMiddleware(authToken))
{
v1.POST("/chat/completions", s.completions)
v1.POST("/v1/engines/copilot-codex/completions", s.codeCompletions)
}
} else {
e.POST("/chat/completions", s.completions)
e.POST("/v1/engines/copilot-codex/completions", s.codeCompletions)
}
}
这些我都做了,的确没有那个Unable to resolve model with family selection: gpt-4
bug了,但却还是有socket hang up这样的bug,不管是chat还是补全都有。该怎么办呢?
大佬,还有就是,我把所有代理全都关掉,也没有任何用处。换了几个wifi都没办法
还有就是api也换了一个,也没用。这两个在chatbox上都是能用的。
vscode 版本 1.91.1
GitHub Copilot 版本 1.213.0
GitHub Copilot Chat 版本 0.17.1
是Intel核的mac电脑
无论挂没挂代理,都有这个问题。而且我还把DNS给换成8.8.8.8和114.114.114.114了,都没用。
copilot插件日志看下。
还有override运行日志也贴出来看下。
可能找到问题。
下面是copilot chat的日志
2024-07-12 23:20:59.602 [info] [auth] Got Copilot token for shay
2024-07-12 23:20:59.799 [info] [auth] Logged in as shay
2024-07-12 23:20:59.976 [info] [ModelMetadataFetcher] Failed to fetch models, Cte: socket hang up
at zPe (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:96:29562)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at qct (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:96:31587)
at XT.fetch (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1290:7302)
at UA._fetchModels (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1291:3211)
at UA.getAllChatModels (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1291:2201)
at ZT.getAllChatEndpoints (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1291:6404)
at p (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1115:593)
at sRe (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1115:1332)
at Yct (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1317:883)
at c.n (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:144:6384)
at c.m (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:144:6347)
at c.l (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:144:5804)
2024-07-12 23:21:00.164 [info] [ModelMetadataFetcher] Failed to fetch models, Cte: socket hang up
at zPe (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:96:29562)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at qct (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:96:31587)
at XT.fetch (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1290:7302)
at UA._fetchModels (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1291:3211)
at UA.getEmbeddingsModel (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1291:2707)
at ZT.getEmbeddingsEndpoint (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1291:6213)
at sRe (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1115:1436)
at Yct (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1317:883)
at c.n (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:144:6384)
at c.m (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:144:6347)
at c.l (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:144:5804)
2024-07-12 23:21:00.504 [info] [ModelMetadataFetcher] Failed to fetch models, Cte: socket hang up
at zPe (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:96:29562)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at qct (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:96:31587)
at XT.fetch (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1290:7302)
at UA._fetchModels (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1291:3211)
at UA.getChatModel (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1291:2329)
at ZT.getChatEndpoint (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1291:5862)
at t.invoke (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:839:3611)
at aM._provideResponseWithProgress (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:872:1222)
at aM.provideResponseWithProgress (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:870:4601)
at n.y (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:882:1826)
at g.$invokeAgent (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:154:50217)
2024-07-12 23:21:00.506 [info] [extension] Cte: socket hang up
at zPe (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:96:29562)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at qct (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:96:31587)
at XT.fetch (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1290:7302)
at UA._fetchModels (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1291:3211)
at UA.getChatModel (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1291:2329)
at ZT.getChatEndpoint (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:1291:5862)
at t.invoke (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:839:3611)
at aM._provideResponseWithProgress (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:872:1222)
at aM.provideResponseWithProgress (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:870:4601)
at n.y (/Users/shay/.vscode/extensions/github.copilot-chat-0.17.1/dist/extension.js:882:1826)
at g.$invokeAgent (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:154:50217)
这是copilot的日志:
2024-07-12 23:25:09.505 [info] [auth] Sucessfully authenticated
2024-07-12 23:25:43.978 [error] [ghostText] Error on ghost text request: FetchError: socket hang up
at fetch (/Users/shay/.vscode/extensions/github.copilot-1.213.0/node_modules/@adobe/helix-fetch/src/fetch/index.js:99:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at cachingFetch (/Users/shay/.vscode/extensions/github.copilot-1.213.0/node_modules/@adobe/helix-fetch/src/fetch/index.js:288:16)
at Fq.fetch (/Users/shay/.vscode/extensions/github.copilot-1.213.0/lib/src/network/helix.ts:92:22)
at SN.fetchWithParameters (/Users/shay/.vscode/extensions/github.copilot-1.213.0/lib/src/openai/fetch.ts:454:26)
at SN.fetchAndStreamCompletions (/Users/shay/.vscode/extensions/github.copilot-1.213.0/lib/src/openai/fetch.ts:349:26)
at genericGetCompletionsFromNetwork (/Users/shay/.vscode/extensions/github.copilot-1.213.0/lib/src/ghostText/ghostText.ts:149:21)
at getGhostText (/Users/shay/.vscode/extensions/github.copilot-1.213.0/lib/src/ghostText/ghostText.ts:690:23)
at calculateInlineCompletions (/Users/shay/.vscode/extensions/github.copilot-1.213.0/extension/src/ghostText/ghostText.ts:79:20)
at provideInlineCompletions (/Users/shay/.vscode/extensions/github.copilot-1.213.0/extension/src/ghostText/ghostText.ts:142:20)
at BM.provideInlineCompletionItems (/Users/shay/.vscode/extensions/github.copilot-1.213.0/extension/src/ghostText/ghostText.ts:158:27)
at J.provideInlineCompletions (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:154:119139) {
type: 'system',
_name: 'FetchError',
code: 'ECONNRESET',
errno: undefined,
erroredSysCall: undefined
}
然后它的日志,很奇怪是一片空白欸。
刚刚试过了,在windows上也会报一模一样的错。就是socket hang up。代理都关掉了。
看起来是客户端的问题,Override服务都没接受到请求
插眼
那咋办,现在这问题还有解吗。还有人跟俺一样吗。
是不是我有哪一步没做呢?
我也运行了那一行代码就是sed开头的那个。
改了main.go之后,运行的这两行
docker compose build
docker compose up -d
还有就是账号也是用的cocopilot.org来登录的。
谢谢大佬,我还是直接用这个了:
这个插件虽然慢,但用override的话还要用docker啥的,感觉也挺难整的。我干脆用它现成的了。
刚才试了一下,改成这玩意儿确实就可以了