ikechan8370 / chatgpt-plugin

云崽系机器人的智能聊天插件
https://www.yunzai.chat/
GNU General Public License v3.0
974 stars 100 forks source link

根据博客教程搭建必应azure反代后返回invalid URL #526

Closed PrussianBlueCN closed 12 months ago

PrussianBlueCN commented 1 year ago

请确保提出问题前更新到最新版本!!!!!!!!

请在提交issue前确认你已阅读了以下资料:

如果你的问题已经在readme或其他Issue中得到解答,我们很可能不会回复。请确保你的问题是一个新的问题。

问题描述

请在此处描述您遇到的问题,包括出现问题的环境、您试图实现的功能以及错误信息等。请尽可能详细,以便其他人可以在自己的环境中复制问题。

根据教程尝试搭建了bing反代(插件默认反代返回200),并将默认域填写在了bing模式设置下的Sydney反代处,同时开启了强制使用反代选项,bing模式也已经选择为自设定。试用结果如图,后台日志附后。

image

环境

机器人运行在centos8的腾讯云服务器上,icqq8.9.68

附加信息

如果有任何其他信息,如日志、截图等,请在此处提供。

0|Miao-Yun | [MiaoYz][16:36:07.317][INFO] recv from: [Private: 550898926(friend)] #chat赞美阿哈 0|Miao-Yun | [MiaoYz][16:36:09.623][INFO] succeed to send: [Private(550898926)] [回复]我正在思考如何回复你,请稍等 0|Miao-Yun | [MiaoYz][16:36:09.624][INFO] chatgpt prompt: 赞美阿哈 0|Miao-Yun | [MiaoYz][16:36:09.625][INFO] { 0|Miao-Yun | previousConversation: { 0|Miao-Yun | sender: { user_id: 550898926, nickname: '正因其徒劳', card: '正因其徒劳' }, 0|Miao-Yun | ctime: '2023-07-25T08:36:09.625Z', 0|Miao-Yun | utime: '2023-07-25T08:36:09.625Z', 0|Miao-Yun | num: 0, 0|Miao-Yun | conversation: {} 0|Miao-Yun | } 0|Miao-Yun | } 0|Miao-Yun | [MiaoYz][16:36:09.627][MARK] { 0|Miao-Yun | conversation: { 0|Miao-Yun | conversationId: undefined, 0|Miao-Yun | parentMessageId: undefined, 0|Miao-Yun | clientId: undefined, 0|Miao-Yun | invocationId: undefined, 0|Miao-Yun | conversationSignature: undefined, 0|Miao-Yun | bingToken: undefined 0|Miao-Yun | } 0|Miao-Yun | } 0|Miao-Yun | [MiaoYz][16:36:09.628][MARK] using bing mode 0|Miao-Yun | [MiaoYz][16:36:10.878][MARK] 使用host:pb320.azurewebsites.net 0|Miao-Yun | [MiaoYz][16:36:10.879][ERRO] TypeError [ERR_INVALID_URL]: Invalid URL 0|Miao-Yun | at new NodeError (node:internal/errors:393:5) 0|Miao-Yun | at URL.onParseError (node:internal/url:565:9) 0|Miao-Yun | at new URL (node:internal/url:645:5) 0|Miao-Yun | at new Request (file:///root/Miao-Yunzai/node_modules/.pnpm/node-fetch@3.3.1/node_modules/node-fetch/src/request.js:55:16) 0|Miao-Yun | at file:///root/Miao-Yunzai/node_modules/.pnpm/node-fetch@3.3.1/node_modules/node-fetch/src/index.js:51:19 0|Miao-Yun | at new Promise () 0|Miao-Yun | at fetch (file:///root/Miao-Yunzai/node_modules/.pnpm/node-fetch@3.3.1/node_modules/node-fetch/src/index.js:49:9) 0|Miao-Yun | at SydneyAIClient.createNewConversation (file:///root/Miao-Yunzai/plugins/chatgpt-plugin/utils/SydneyAIClient.js:110:26) 0|Miao-Yun | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 0|Miao-Yun | at async SydneyAIClient.sendMessage (file:///root/Miao-Yunzai/plugins/chatgpt-plugin/utils/SydneyAIClient.js:234:45) { 0|Miao-Yun | input: 'pb320.azurewebsites.net/turing/conversation/create', 0|Miao-Yun | code: 'ERR_INVALID_URL' 0|Miao-Yun | } 0|Miao-Yun | [MiaoYz][16:36:10.882][MARK] 使用host:pb320.azurewebsites.net 0|Miao-Yun | [MiaoYz][16:36:10.882][ERRO] TypeError [ERR_INVALID_URL]: Invalid URL 0|Miao-Yun | at new NodeError (node:internal/errors:393:5) 0|Miao-Yun | at URL.onParseError (node:internal/url:565:9) 0|Miao-Yun | at new URL (node:internal/url:645:5) 0|Miao-Yun | at new Request (file:///root/Miao-Yunzai/node_modules/.pnpm/node-fetch@3.3.1/node_modules/node-fetch/src/request.js:55:16) 0|Miao-Yun | at file:///root/Miao-Yunzai/node_modules/.pnpm/node-fetch@3.3.1/node_modules/node-fetch/src/index.js:51:19 0|Miao-Yun | at new Promise () 0|Miao-Yun | at fetch (file:///root/Miao-Yunzai/node_modules/.pnpm/node-fetch@3.3.1/node_modules/node-fetch/src/index.js:49:9) 0|Miao-Yun | at SydneyAIClient.createNewConversation (file:///root/Miao-Yunzai/plugins/chatgpt-plugin/utils/SydneyAIClient.js:110:26) 0|Miao-Yun | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 0|Miao-Yun | at async SydneyAIClient.sendMessage (file:///root/Miao-Yunzai/plugins/chatgpt-plugin/utils/SydneyAIClient.js:234:45) { 0|Miao-Yun | input: 'pb320.azurewebsites.net/turing/conversation/create', 0|Miao-Yun | code: 'ERR_INVALID_URL' 0|Miao-Yun | } 0|Miao-Yun | [MiaoYz][16:36:10.885][MARK] 使用host:pb320.azurewebsites.net 0|Miao-Yun | [MiaoYz][16:36:10.885][ERRO] TypeError [ERR_INVALID_URL]: Invalid URL 0|Miao-Yun | at new NodeError (node:internal/errors:393:5) 0|Miao-Yun | at URL.onParseError (node:internal/url:565:9) 0|Miao-Yun | at new URL (node:internal/url:645:5) 0|Miao-Yun | at new Request (file:///root/Miao-Yunzai/node_modules/.pnpm/node-fetch@3.3.1/node_modules/node-fetch/src/request.js:55:16) 0|Miao-Yun | at file:///root/Miao-Yunzai/node_modules/.pnpm/node-fetch@3.3.1/node_modules/node-fetch/src/index.js:51:19 0|Miao-Yun | at new Promise () 0|Miao-Yun | at fetch (file:///root/Miao-Yunzai/node_modules/.pnpm/node-fetch@3.3.1/node_modules/node-fetch/src/index.js:49:9) 0|Miao-Yun | at SydneyAIClient.createNewConversation (file:///root/Miao-Yunzai/plugins/chatgpt-plugin/utils/SydneyAIClient.js:110:26) 0|Miao-Yun | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 0|Miao-Yun | at async SydneyAIClient.sendMessage (file:///root/Miao-Yunzai/plugins/chatgpt-plugin/utils/SydneyAIClient.js:234:45) { 0|Miao-Yun | input: 'pb320.azurewebsites.net/turing/conversation/create', 0|Miao-Yun | code: 'ERR_INVALID_URL' 0|Miao-Yun | } 0|Miao-Yun | [MiaoYz][16:36:10.886][INFO] { text: 'Invalid URL', error: true } 0|Miao-Yun | {"level":30,"time":1690274170895,"pid":3105200,"hostname":"VM-8-17-centos","reqId":"req-1","req":{"method":"POST","url":"/cache","hostname":"127.0.0.1:3321","remoteAddress":"::ffff:127.0.0.1","remotePort":58808},"msg":"incoming request"} 0|Miao-Yun | {"level":30,"time":1690274171568,"pid":3105200,"hostname":"VM-8-17-centos","reqId":"req-1","res":{"statusCode":200},"responseTime":671.870879650116,"msg":"request completed"} 0|Miao-Yun | [MiaoYz][16:36:11.905][INFO] succeed to send: [Private(550898926)] Invalid URL

HalcyonAlcedo commented 1 year ago

反代格式是http(s)://example.com,请根据你的反代进行配置,你的格式不正确

ikechan8370 commented 1 year ago

没加https://

PrussianBlueCN commented 1 year ago

感谢二位帮助,加上http(s)后改为返回200了,劳烦再帮忙看一下? 0|Miao-Yunzai | [MiaoYz][19:57:47.394][INFO] recv from: [Private: 550898926(friend)] #chat阿哈! 0|Miao-Yunzai | [MiaoYz][19:57:50.858][INFO] succeed to send: [Private(550898926)] [回复]我正在思考如何回复你,请稍等 0|Miao-Yunzai | [MiaoYz][19:57:50.859][INFO] chatgpt prompt: 阿哈! 0|Miao-Yunzai | [MiaoYz][19:57:50.860][INFO] { 0|Miao-Yunzai | previousConversation: { 0|Miao-Yunzai | sender: { user_id: 550898926, nickname: '正因其徒劳', card: '正因其徒劳' }, 0|Miao-Yunzai | ctime: '2023-07-25T11:57:50.860Z', 0|Miao-Yunzai | utime: '2023-07-25T11:57:50.860Z', 0|Miao-Yunzai | num: 0, 0|Miao-Yunzai | conversation: {} 0|Miao-Yunzai | } 0|Miao-Yunzai | } 0|Miao-Yunzai | [MiaoYz][19:57:50.860][MARK] { 0|Miao-Yunzai | conversation: { 0|Miao-Yunzai | conversationId: undefined, 0|Miao-Yunzai | parentMessageId: undefined, 0|Miao-Yunzai | clientId: undefined, 0|Miao-Yunzai | invocationId: undefined, 0|Miao-Yunzai | conversationSignature: undefined, 0|Miao-Yunzai | bingToken: undefined 0|Miao-Yunzai | } 0|Miao-Yunzai | } 0|Miao-Yunzai | [MiaoYz][19:57:50.860][MARK] using bing mode 0|Miao-Yunzai | [MiaoYz][19:57:50.864][MARK] 使用host:https://pb320.azurewebsites.net 0|Miao-Yunzai | { 0|Miao-Yunzai | conversationId: '51D|BingProd|1E93A4AA501672852A68475EAC7821E3058B58B61BEAE359EB26EFEE03C70CF6', 0|Miao-Yunzai | clientId: '844428507973573', 0|Miao-Yunzai | conversationSignature: 'wEcIT5eyXhzh9B3KmjWVavWwru4TH+vc2ULC5OPbyCM=', 0|Miao-Yunzai | result: { value: 'Success', message: null } 0|Miao-Yunzai | } 0|Miao-Yunzai | [MiaoYz][19:57:52.994][MARK] use sydney websocket host: wss://sydney.bing.com 0|Miao-Yunzai | Error: Unexpected server response: 200 0|Miao-Yunzai | at ClientRequest. (/root/Miao-Yunzai/node_modules/.pnpm/ws@8.13.0/node_modules/ws/lib/websocket.js:888:7) 0|Miao-Yunzai | at ClientRequest.emit (node:events:513:28) 0|Miao-Yunzai | at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:688:27) 0|Miao-Yunzai | at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17) 0|Miao-Yunzai | at TLSSocket.socketOnData (node:_http_client:530:22) 0|Miao-Yunzai | at TLSSocket.emit (node:events:513:28) 0|Miao-Yunzai | at addChunk (node:internal/streams/readable:324:12) 0|Miao-Yunzai | at readableAddChunk (node:internal/streams/readable:297:9) 0|Miao-Yunzai | at Readable.push (node:internal/streams/readable:234:10) 0|Miao-Yunzai | at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) 0|Miao-Yunzai | disconnected 0|Miao-Yunzai | [MiaoYz][19:57:53.247][ERRO] Error: Unexpected server response: 200 0|Miao-Yunzai | at ClientRequest. (/root/Miao-Yunzai/node_modules/.pnpm/ws@8.13.0/node_modules/ws/lib/websocket.js:888:7) 0|Miao-Yunzai | at ClientRequest.emit (node:events:513:28) 0|Miao-Yunzai | at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:688:27) 0|Miao-Yunzai | at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17) 0|Miao-Yunzai | at TLSSocket.socketOnData (node:_http_client:530:22) 0|Miao-Yunzai | at TLSSocket.emit (node:events:513:28) 0|Miao-Yunzai | at addChunk (node:internal/streams/readable:324:12) 0|Miao-Yunzai | at readableAddChunk (node:internal/streams/readable:297:9) 0|Miao-Yunzai | at Readable.push (node:internal/streams/readable:234:10) 0|Miao-Yunzai | at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) 0|Miao-Yunzai | [MiaoYz][19:57:53.250][MARK] 使用host:https://pb320.azurewebsites.net 0|Miao-Yunzai | { 0|Miao-Yunzai | conversationId: '51D|BingProd|EEB338C35AB032D9109A89FA0D868AE9317AB6B4D3DE5CFB787BADF5E5991655', 0|Miao-Yunzai | clientId: '844428507973573', 0|Miao-Yunzai | conversationSignature: 'R68XripMqHZANkzl/9/7wupMGByKRNb4Cd4f08O+OKY=', 0|Miao-Yunzai | result: { value: 'Success', message: null } 0|Miao-Yunzai | } 0|Miao-Yunzai | [MiaoYz][19:57:53.854][MARK] use sydney websocket host: wss://sydney.bing.com 0|Miao-Yunzai | Error: Unexpected server response: 200 0|Miao-Yunzai | at ClientRequest. (/root/Miao-Yunzai/node_modules/.pnpm/ws@8.13.0/node_modules/ws/lib/websocket.js:888:7) 0|Miao-Yunzai | at ClientRequest.emit (node:events:513:28) 0|Miao-Yunzai | at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:688:27) 0|Miao-Yunzai | at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17) 0|Miao-Yunzai | at TLSSocket.socketOnData (node:_http_client:530:22) 0|Miao-Yunzai | at TLSSocket.emit (node:events:513:28) 0|Miao-Yunzai | at addChunk (node:internal/streams/readable:324:12) 0|Miao-Yunzai | at readableAddChunk (node:internal/streams/readable:297:9) 0|Miao-Yunzai | at Readable.push (node:internal/streams/readable:234:10) 0|Miao-Yunzai | at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) 0|Miao-Yunzai | disconnected 0|Miao-Yunzai | [MiaoYz][19:57:54.320][ERRO] Error: Unexpected server response: 200 0|Miao-Yunzai | at ClientRequest. (/root/Miao-Yunzai/node_modules/.pnpm/ws@8.13.0/node_modules/ws/lib/websocket.js:888:7) 0|Miao-Yunzai | at ClientRequest.emit (node:events:513:28) 0|Miao-Yunzai | at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:688:27) 0|Miao-Yunzai | at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17) 0|Miao-Yunzai | at TLSSocket.socketOnData (node:_http_client:530:22) 0|Miao-Yunzai | at TLSSocket.emit (node:events:513:28) 0|Miao-Yunzai | at addChunk (node:internal/streams/readable:324:12) 0|Miao-Yunzai | at readableAddChunk (node:internal/streams/readable:297:9) 0|Miao-Yunzai | at Readable.push (node:internal/streams/readable:234:10) 0|Miao-Yunzai | at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) 0|Miao-Yunzai | [MiaoYz][19:57:54.322][MARK] 使用host:https://pb320.azurewebsites.net 0|Miao-Yunzai | { 0|Miao-Yunzai | conversationId: '51D|BingProd|EC69C526982673B4A8AEC8A200CBB4D25B69E0D4F2A5C0DDCE134B613681D5E4', 0|Miao-Yunzai | clientId: '844428507973573', 0|Miao-Yunzai | conversationSignature: 'qDynoHBY3N1wQE7fimQe+Jn+q3J+3WV3PJ/YbQ3TprA=', 0|Miao-Yunzai | result: { value: 'Success', message: null } 0|Miao-Yunzai | } 0|Miao-Yunzai | [MiaoYz][19:57:54.847][MARK] use sydney websocket host: wss://sydney.bing.com 0|Miao-Yunzai | Error: Unexpected server response: 200 0|Miao-Yunzai | at ClientRequest. (/root/Miao-Yunzai/node_modules/.pnpm/ws@8.13.0/node_modules/ws/lib/websocket.js:888:7) 0|Miao-Yunzai | at ClientRequest.emit (node:events:513:28) 0|Miao-Yunzai | at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:688:27) 0|Miao-Yunzai | at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17) 0|Miao-Yunzai | at TLSSocket.socketOnData (node:_http_client:530:22) 0|Miao-Yunzai | at TLSSocket.emit (node:events:513:28) 0|Miao-Yunzai | at addChunk (node:internal/streams/readable:324:12) 0|Miao-Yunzai | at readableAddChunk (node:internal/streams/readable:297:9) 0|Miao-Yunzai | at Readable.push (node:internal/streams/readable:234:10) 0|Miao-Yunzai | at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) 0|Miao-Yunzai | disconnected 0|Miao-Yunzai | [MiaoYz][19:57:55.051][ERRO] Error: Unexpected server response: 200 0|Miao-Yunzai | at ClientRequest. (/root/Miao-Yunzai/node_modules/.pnpm/ws@8.13.0/node_modules/ws/lib/websocket.js:888:7) 0|Miao-Yunzai | at ClientRequest.emit (node:events:513:28) 0|Miao-Yunzai | at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:688:27) 0|Miao-Yunzai | at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17) 0|Miao-Yunzai | at TLSSocket.socketOnData (node:_http_client:530:22) 0|Miao-Yunzai | at TLSSocket.emit (node:events:513:28) 0|Miao-Yunzai | at addChunk (node:internal/streams/readable:324:12) 0|Miao-Yunzai | at readableAddChunk (node:internal/streams/readable:297:9) 0|Miao-Yunzai | at Readable.push (node:internal/streams/readable:234:10) 0|Miao-Yunzai | at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) 0|Miao-Yunzai | [MiaoYz][19:57:55.051][INFO] { text: 'Unexpected server response: 200', error: true } 0|Miao-Yunzai | {"level":30,"time":1690286275054,"pid":3164651,"hostname":"VM-8-17-centos","reqId":"req-4","req":{"method":"POST","url":"/cache","hostname":"127.0.0.1:3321","remoteAddress":"::ffff:127.0.0.1","remotePort":39456},"msg":"incoming request"} 0|Miao-Yunzai | {"level":30,"time":1690286275056,"pid":3164651,"hostname":"VM-8-17-centos","reqId":"req-4","res":{"statusCode":200},"responseTime":1.093766689300537,"msg":"request completed"} 0|Miao-Yunzai | [MiaoYz][19:57:56.000][INFO] succeed to send: [Private(550898926)] Unexpected server response: 200

ikechan8370 commented 12 months ago

你没有开对话使用反代

PrussianBlueCN commented 12 months ago

感谢