Code Monkey home page Code Monkey logo

chatgpt-wecom's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatgpt-wecom's Issues

如何与企业微信的机器人对接呢

自创应用已经成功,但是如何与企业微信中的机器人链接呢,我用机器人的webhook url 替代conf里面的url里面,得到结果就是: 响应失败,错误码:93000,错误原因:invalid webhook url

服务器能接收到企业微信的消息,但没有回复呀

[90m2023-03-04T10:59:52Z�[0m ERROR �[1m../../../app/internal/api/receive.go:43�[0m�[36m >�[0m Get GPT Response error: CreateCompletion failed: Post "https://api.openai.com/v1/completions": dial tcp 168.143.171.93:443: i/o timeout �[36merror=�[0m�[31m"CreateCompletion failed: Post "https://api.openai.com/v1/completions": dial tcp 168.143.171.93:443: i/o timeout"�[0m
2023/03/04 10:59:52 CreateCompletion failed: Post "https://api.openai.com/v1/completions": dial tcp 168.143.171.93:443: i/o timeout

chatgpt 4.0 接口

刚发布了, 想尝鲜,不知道是否有接口了,请大佬关注和更新。 /膜拜

0.1.5 获取企业微信access token时候报错

    2023-03-10T07:25:49Z INFO   ../../../app/internal/api/receive.go:116 > [AgentId: 1000019] [UserId: SHEN] Start Send Wecom Response: 欢迎来到 ChatGPT,在这里您可以和我对话,我将尽我所能回答您的问题。如果想关闭会话,请回复“/restart”。

2023-03-10T07:25:49Z DEBUG  ../../../app/pkg/wecom/wecom.go:58 > [Request] URL: /cgi-bin/gettoken, Method: GET, Query: map[corpid:[XXXXX] corpsecret:[XXXXXX]], Form: map[], Body: <nil>, Headers: map[]

2023/03/10 07:25:54.269922 ERROR RESTY Get "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=XXXX&corpsecret=XXXXX": context deadline exceeded (Client.Timeout exceeded while awaiting headers), Attempt 1

在Get token 时候报错, 同样的参数在浏览器用get 可以看到正确的access token.

{"errcode":0,"errmsg":"ok","access_token":"-fuxLajhLWGmioaIxfWnpg3FpM552-hAsV4QU4kmwKCAbcGFsV3WVWCYAng","expires_in":7200}

返回信息失败

`
{"level":"debug","time":"2023-03-07T11:07:46Z","caller":"/go/pkg/mod/github.com/fanchunke/[email protected]/client.go:219","message":"User: cxkj_xxx, Messages with conversation: [{"role":"user","content":\ "测试"}]"}
{"level":"error","error":"CreateCompletion failed: Post "https://api.openai.com/v1/chat/completions\": dial tcp: lookup api.openai.com: device or resource busy","time":"2023-03-07T11:07:46Z","caller":"/app /internal/api/receive.go:59","message":"Get GPT Response error: CreateCompletion failed: Post "https://api.openai.com/v1/chat/completions\": dial tcp: lookup api.openai.com: device or resource busy"}

`
请问各位大佬,这问题怎么解决?

能出一个docker安装的小白教程吗?

如何有一个详细的安装教程,是很多愿意尝试的小白得以下手和传播。如果有视频教程就更优秀了,非常感谢您辛勤的付出,和奉献。

Get GPT Response error: CreateCompletion failed: Post "https://api.openai.com/v1/completions": dial tcp: lookup api.openai.com: device or resource busy error="CreateCompletion failed: Post \"https://api.openai.com/v1/completions\": dial tcp: lookup api.openai.com: device or resource busy"

2023-02-20T15:29:44Z ERROR ../../../app/internal/api/receive.go:43 > Get GPT Response error: CreateCompletion failed: Post "https://api.openai.com/v1/completions": dial tcp: lookup api.openai.com: device or resource busy error="CreateCompletion failed: Post \"https://api.openai.com/v1/completions\": dial tcp: lookup api.openai.com: device or resource busy"

有Log大小上限吗?

日志文件有大小上限吗?debug级别的输出会比较多,日志文件如果没有rotation, 久了会撑爆的。最好可以配置日志上限,或者硬编码比如10MB也行啊。 如果有了,请忽略。

docker 进入不了镜像的bash会报错

image

root@ser720184626473:~/chatgpt-wecom# docker-compose up -d Creating chatgpt-wecom ... done root@ser720184626473:~/chatgpt-wecom# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 040e27c08832 chatgpt-wecom_chatgpt-wecom "./app" 8 seconds ago Restarting (1) Less than a second ago chatgpt-wecom 7fdfc045d1a9 teampgm/pagermaid_pyro "sh utils/docker-con…" 4 weeks ago Up 3 hours PagerMaid root@ser720184626473:~/chatgpt-wecom# docker exec -it 040e27c08832 bash Error response from daemon: Container 040e27c08832f21d1dde3acb65e0ffd0c5942dc33bec03ffcb415c5d2e98fdf5 is restarting, wait until the container is running root@ser720184626473:~/chatgpt-wecom#

我是 docker 方式部署运行的,但是出现了以下错误

�[90m2023-02-26T08:34:16Z�[0m ERROR �[1mroot/workspace/chatqpt-wecom_BqLG/internal/api/receive.go:43�[0m�[36m >�[0m Get GPT Response error: CreateCompletion failed: Post "https://api.openai.com/v1/completions": x509: certificate signed by unknown authority �[36merror=�[0m�[31m"CreateCompletion failed: Post "https://api.openai.com/v1/completions": x509: certificate signed by unknown authority"�[0m

2023/02/26 08:34:16 CreateCompletion failed: Post "https://api.openai.com/v1/completions": x509: certificate signed by unknown authority

x509: certificate signed by unknown authority

这个跟部署环境有关系吗,我是部署在上海的

gpt-3.5版本gpt返回企业微信返回失败

引用:#10

[GIN] 2023/03/09 - 08:45:10 | 404 |     555.801µs |   54.249.18.254 | POST     "/wecom/receive/v2/cgi-bin/message/send?access_token="
2023-03-09T08:45:10Z DEBUG  ../../Users/fanchunke/workspace/chatgpt/chatgpt-wecom/pkg/wecom/wecom.go:69 > [Response] Status: 404, Body: 404 page not found, Headers; map[Connection:[keep-alive] Content-Length:[18] Content-Type:[text/plain] Date:[Thu, 09 Mar 2023 08:45:10 GMT] Server:[nginx/1.18.0] X-Request-Id:[cg4pp5hlg1eth8fn8qig]]
2023/03/09 08:45:10.682357 ERROR RESTY 请求失败, Attempt 1
2023-03-09T08:45:10Z ERROR  ../../Users/fanchunke/workspace/chatgpt/chatgpt-wecom/pkg/wecom/wecom.go:92 > 请求失败 error="请求失败"
2023-03-09T08:45:10Z ERROR  ../../Users/fanchunke/workspace/chatgpt/chatgpt-wecom/internal/api/receive.go:83 > Send Wecom Response error: Send Wecom Message failed: 请求失败 error="Send Wecom Message failed: 请求失败"
2023/03/09 08:45:10 Send Wecom Message failed: 请求失败

使用sqllite启动时候报错:go-sqlite3 requires cgo to work

windows系统,非docker环境运行,错误日志如下:
{"level":"fatal","error":"sqlite: check foreign_keys pragma: reading schema information Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub","time":"2023-03-03T14:22:01+08:00","caller":"/Users/fanchunke/workspace/chatgpt/chatgpt-wecom/internal/app/app.go:35","message":"ent - database migrate failed"}

返回响应:400

image

接入企业微信后,输出prompt没有返回chatGPT的响应,后台出现了上面的错误,请问是什么原因?

0m Get GPT Response error: CreateCompletion failed

�[90m2023-03-04T15:58:56Z�[0m ERROR �[1m../../../app/internal/api/receive.go:43�[0m�[36m >�[: Post "https://api.openai.com/v1/completions": read tcp 172.17.0.2:54742->52.152.96.252:443: read: connection reset by peer �[36merror=�[0m�[31m"CreateCompletion failed: Post "https://api.openai.com/v1/completions": read tcp 172.17.0.2:54742->52.152.96.252:443: read: connection reset by peer"�[0m
2023/03/04 15:58:56 CreateCompletion failed: Post "https://api.openai.com/v1/completions": read tcp 172.17.0.2:54742->52.152.96.252:443: read: connection reset by peer

"message":"Convert wecom msg error: UnSupported MsgType: event"

数据库有存消息但企业微信没回复log日志提示
{"level":"error","url":"/wecom/receive?msg_signature=c32c3123cb23a9caf106d83145315438eb435d49&timestamp=1676529022&nonce=1676457839","method":"POST","requestId":"cfmsqvj52fjj6fpq1gb0","error":"UnSupported MsgType: event","time":"2023-02-16T06:30:22Z","caller":"/app/internal/api/receive.go:31","message":"Convert wecom msg error: UnSupported MsgType: event"}

增加请求频次限制

如果请求过多,OpenAI可能会封IP

CreateCompletion failed: error, status code: 500, message: The server had an error while processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if the error persists.

除了 docker,有没有可能直接用腾讯云函数实现啊

RT,如果能使用腾讯云函数作为中转,实现企业微信应用调用chatGPT,那就爽了

因为之前腾讯云域名备案,一定要有个服务器ip,就买了云函数备案包,3年有效期……平时没啥用,docker 的话,还得搞个云主机吧

Removing intermediate container a46fc6720189

您好,请问在做到

构建镜像
make dockerenv

这一步时,出现这个提示。请问我该怎么处理?谢谢。

Step 11/17 : RUN go build -ldflags '-linkmode external -extldflags "-static"' -o /bin/chatgpt-wecom ./cmd/app
 ---> Running in a46fc6720189
# github.com/fanchunke/chatgpt-wecom/cmd/app
/usr/bin/ld: /tmp/go-link-541147318/000010.o: in function `unixDlOpen':
/go/pkg/mod/github.com/mattn/[email protected]/sqlite3-binding.c:42050: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /tmp/go-link-541147318/000016.o: in function `_cgo_2ac87069779a_C2func_getaddrinfo':
/tmp/go-build/cgo-gcc-prolog:58: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Removing intermediate container a46fc6720189

maxprocs: Leaving GOMAXPROCS=4: CPU quota undefined

root@VM-4-5-debian:~/chatgpt-wecom# docker exec -it chatgpt-wecom sh
/home/works/program # ./app -conf=conf/online.conf -init-ent
2023/02/18 05:25:01 maxprocs: Leaving GOMAXPROCS=4: CPU quota undefined
/home/works/program #

企业微信配置都没问题

warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

github.com/fanchunke/chatgpt-wecom/cmd/app

/usr/bin/ld: /tmp/go-link-3718870333/000010.o: in function unixDlOpen': /go/pkg/mod/github.com/mattn/[email protected]/sqlite3-binding.c:42050: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/bin/ld: /tmp/go-link-3718870333/000016.o: in function _cgo_6cc2654a8ed3_C2func_getaddrinfo':
/tmp/go-build/cgo-gcc-prolog:58: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

有会话上限设置吗?

我知道用户输入/restart可以重置对话,但如果用户不知道或忽略了这操作。会话会持续增加,token消耗,回复准确度也会有影响。我没看到有哪里可以配置会话上限的配置。如果有(比如最多对话10次)请告知一下;如果没有,我想不要脸的请求添加此配置。

会封号吗?

最近接入微信封号了好多,接入企业微信不知道咋样

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.