gtoxlili / wechat-chatgpt Goto Github PK
View Code? Open in Web Editor NEW实现微信公众号被动返回接口的ChatGPT
License: GNU General Public License v3.0
实现微信公众号被动返回接口的ChatGPT
License: GNU General Public License v3.0
目前已经能正常开启对话,但仅能建立握手信息,提出问题就会超时。
INFO[2022-12-13 23:09:16] 用户 ogY6UuP9-yMo-VAyj4zlyBvYrOLY 启动新的对话
INFO[2022-12-13 23:09:21] [消息接收] Type: text, From: ogY6UuP9-yMo-VAyj4zlyBvYrOLY, MsgId: 23922168065204906, Content: 你好
INFO[2022-12-13 23:09:26] [消息接收] Type: text, From: ogY6UuP9-yMo-VAyj4zlyBvYrOLY, MsgId: 23922168065204906, Content: 你好
INFO[2022-12-13 23:09:28] "POST http://shenjia.de/weChatGPT?signature=c23ca0374ab7c05c78c7dc8be414eaacd7951638×tamp=1670944156&nonce=364379646&openid=ogY6UuP9-yMo-VAyj4zlyBvYrOLY HTTP/1.1" from 127.0.0.1:42182 - 200 342B in 11.500110323s
INFO[2022-12-13 23:09:28] "POST http://shenjia.de/weChatGPT?signature=c23ca0374ab7c05c78c7dc8be414eaacd7951638×tamp=1670944156&nonce=364379646&openid=ogY6UuP9-yMo-VAyj4zlyBvYrOLY HTTP/1.1" from 127.0.0.1:43854 - 200 342B in 1.417098614s
INFO[2022-12-13 23:09:28] "POST http://shenjia.de/weChatGPT?signature=c23ca0374ab7c05c78c7dc8be414eaacd7951638×tamp=1670944156&nonce=364379646&openid=ogY6UuP9-yMo-VAyj4zlyBvYrOLY HTTP/1.1" from 127.0.0.1:43850 - 200 342B in 6.427933569s
INFO[2022-12-13 23:09:45] [消息接收] Type: text, From: ogY6UuP9-yMo-VAyj4zlyBvYrOLY, MsgId: 23922167016461479, Content: 为什么你的请求总超时?
INFO[2022-12-13 23:09:45] 用户 ogY6UuP9-yMo-VAyj4zlyBvYrOLY 继续对话
INFO[2022-12-13 23:09:50] [消息接收] Type: text, From: ogY6UuP9-yMo-VAyj4zlyBvYrOLY, MsgId: 23922167016461479, Content: 为什么你的请求总超时?
INFO[2022-12-13 23:09:55] [消息接收] Type: text, From: ogY6UuP9-yMo-VAyj4zlyBvYrOLY, MsgId: 23922167016461479, Content: 为什么你的请求总超时?
panic: context canceled
goroutine 27 [running]:
wxChatGPT/chatGPT/handler.(*UserInfo).SendMsg(0xc0003db700, {0x8051d8, 0xc000059980}, {0xc000259200, 0x45f}, 0xc000079b30, {0xc00045b6e0?, 0x0?})
/root/wechat-chatGPT/chatGPT/handler/userHandler.go:58 +0x678
wxChatGPT/chatGPT.(*ChatGPT).SendMsg(0xc000012468, {0xc00045b6e0, 0x21}, {0xc0001748c0, 0x1c}, {0x8051d8, 0xc000059980})
/root/wechat-chatGPT/chatGPT/chatGPT.go:119 +0x22f
wxChatGPT/chatGPT.(*ChatGPT).SendMsgChan.func1()
/root/wechat-chatGPT/chatGPT/chatGPT.go:102 +0x3e
created by wxChatGPT/chatGPT.(*ChatGPT).SendMsgChan
/root/wechat-chatGPT/chatGPT/chatGPT.go:101 +0x12e
exit status 2
如题,我已经在config.json中填好了session-token和cf_clearance,并用提供的命令(替换了微信Token)进行编译,但运行起来之后访问接口提示404 Page not found.
curl 127.0.0.1:7458 404 page not found
此时服务端的日志如下:
INFO[2022-12-13 18:57:14] Server listening at [::]:7458 INFO[2022-12-13 19:00:31] "GET http://127.0.0.1:7458/ HTTP/1.1" from 127.0.0.1:37668 - 404 19B in 18.37µs
请问可能是哪里出了问题?
是没有用chatgpt的api接口吗
当我在 sessionToken 中增加 __Secure-next-auth.session-token 后,运行出现错误
错误代码如下:
$ go run main.go
2022/12/09 16:45:16 net/http: invalid byte '\n' in Cookie.Value; dropping invalid bytes
INFO[2022-12-09 16:45:16] Server listening at [::]:7458
panic: interface conversion: interface {} is nil, not string
goroutine 6 [running]:
wx-ChatGPT/chatGPT.(*ChatGPT).updateSessionToken(0xc000024520)
/Users/li/chatGPT/wechat-chatGPT/chatGPT/chatGPT.go:83 +0x525
wx-ChatGPT/chatGPT.newChatGPT.func1()
/Users/li/chatGPT/wechat-chatGPT/chatGPT/chatGPT.go:45 +0x25
created by wx-ChatGPT/chatGPT.newChatGPT
/Users/li/chatGPT/wechat-chatGPT/chatGPT/chatGPT.go:44 +0xef
exit status 2
可以开一个合适的价格。Email:[email protected]
公众号ChatGPT对话,采取Plus或者Pro版的个人token,还是Beta版的官方API效果好?
OpenAI官方公开的是beta版:https://platform.openai.com/docs/
怎样提高到15秒回复呢?
我看目前使用的是接收消息同步调用chatgpt然后返回,可以考虑使用客服消息异步返回:客服消息接口
看了你的程序,跟我们目前的开发计划有关联,觉得可以合作一些项目。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.