maxduke / go-chatgpt-api

一个尝试绕过 Cloudflare 来使用 ChatGPT 接口的程序
MIT License
141 stars 33 forks source link

对话中途断开 #64

Closed xixi-furry closed 1 month ago

xixi-furry commented 1 month ago

不知道是不是我的问题,在请求过后,发现有连续两次都是直接断开没有说完,cws也没有任何的提示,日志也是。以下是log:

go-chatgpt-api:

go-chatgpt-api  | [GIN] 2024/05/27 - 09:30:37 | 200 |  138.342181ms |     192.168.0.7 | GET      "/chatgpt/backend-api/files/file-uGbThb8******97q/download"
go-chatgpt-api  | INFO[168306] POW Difficulty: 00015a , took 324 ms 
go-chatgpt-api  | [GIN] 2024/05/27 - 09:31:53 | 200 | 17.914533034s |     192.168.0.7 | POST     "/chatgpt/backend-api/conversation"
go-chatgpt-api  | [GIN] 2024/05/27 - 10:02:24 | 200 |  527.205658ms |     192.168.0.7 | GET      "/chatgpt/backend-api/files/file-u***********7Bcuy97q/download"
go-chatgpt-api  | [GIN] 2024/05/27 - 10:02:53 | 200 |  463.725034ms |     192.168.0.7 | GET      "/chatgpt/backend-api/conversation/0c35701b-ec388888888888888"
go-chatgpt-api  | WARN[171200] Proof of work difficulty too high: 000032. Retrying... 1/1  
go-chatgpt-api  | INFO[171208] POW Difficulty: 00007b , took 7065 ms 
go-chatgpt-api  | [GIN] 2024/05/27 - 10:20:27 | 200 | 37.940764294s |     192.168.0.7 | POST     "/chatgpt/backend-api/conversation"
go-chatgpt-api  | [GIN] 2024/05/27 - 10:22:11 | 200 |  518.664548ms |     192.168.0.7 | GET      "/chatgpt/backend-api/conversation/0c35701b-e888888888****-*******"
go-chatgpt-api  | INFO[171415] POW Difficulty: 0002bc , took 138 ms 
go-chatgpt-api  | [GIN] 2024/05/27 - 10:23:54 | 200 | 30.520462678s |     192.168.0.7 | POST     "/chatgpt/backend-api/conversation"

Docker compose 的环境变量:

       environment:
            - TZ=Asia/Shanghai
            # - OPENAI_EMAIL=
            # - OPENAI_PASSWORD=
            - OPENAI_REFRESH_TOKEN=
            #- PROXY=
            - HARDWARE=
            - POW_MAX_CALC_TIMES=600000
            - POW_RETRY_TIMES=1
            - POW_MAX_DIFFICULTY=

CWS的log:

2024/05/27 10:19:49.667     INFO: [uvicorn.error]   ('192.168.0.5', 0) - "WebSocket /chat" [accepted]
2024/05/27 10:19:49.672     INFO: [uvicorn.error]   connection open
2024/05/27 10:19:49.680     INFO: [cws.api.routers.chat]    xixi connected to websocket
2024/05/27 10:20:27.931    DEBUG: [cws.api.routers.chat]    finished ask 0c3570112312312312369c7f20 (gpt_4), user: 1, ask: 37.976s, total: 37.976s
2024/05/27 10:20:28.158     INFO: [uvicorn.error]   connection closed
2024/05/27 10:20:28.426     INFO: [cws.access]  192.168.0.5:0 | GET /conv HTTP/1.1 | 200 OK | 48 ms
2024/05/27 10:20:28.686     INFO: [cws.access]  192.168.0.5:0 | GET /user/me HTTP/1.1 | 200 OK | 40 ms
2024/05/27 10:22:09.499     INFO: [cws.access]  192.168.0.5:0 | GET /user/me HTTP/1.1 | 200 OK | 42 ms
2024/05/27 10:22:09.862     INFO: [cws.access]  192.168.0.5:0 | GET /conv HTTP/1.1 | 200 OK | 37 ms
2024/05/27 10:22:12.061     INFO: [cws.access]  192.168.0.5:0 | GET /conv/0c35712312369c7f20 HTTP/1.1 | 200 OK | 764 ms
2024/05/27 10:23:23.374     INFO: [cws.access]  192.168.0.5:0 | GET /arkose/info HTTP/1.1 | 200 OK | 44 ms
2024/05/27 10:23:24.019     INFO: [uvicorn.error]   ('192.168.0.5', 0) - "WebSocket /chat" [accepted]
2024/05/27 10:23:24.023     INFO: [uvicorn.error]   connection open
2024/05/27 10:23:24.037     INFO: [cws.api.routers.chat]    xixi connected to websocket
2024/05/27 10:23:54.870    DEBUG: [cws.api.routers.chat]    finished ask 0c35701123123123469c7f20 (gpt_4), user: 1, ask: 30.557s, total: 30.557s
2024/05/27 10:23:55.094     INFO: [uvicorn.error]   connection closed
2024/05/27 10:23:55.376     INFO: [cws.access]  192.168.0.5:0 | GET /conv HTTP/1.1 | 200 OK | 49 ms
2024/05/27 10:23:55.645     INFO: [cws.access]  192.168.0.5:0 | GET /user/me HTTP/1.1 | 200 OK | 39 ms
2024/05/27 10:24:26.545     INFO: [cws.access]  192.168.0.5:0 | GET /system/info HTTP/1.1 | 200 OK | 149 ms
2024/05/27 10:24:26.740     INFO: [cws.access]  192.168.0.5:0 | GET /system/stats/ask?granularity=1800 HTTP/1.1 | 200 OK | 327 ms
2024/05/27 10:24:26.772     INFO: [cws.access]  192.168.0.5:0 | GET /system/stats/request?granularity=1800 HTTP/1.1 | 200 OK | 358 ms
2024/05/27 10:24:26.775     INFO: [cws.access]  192.168.0.5:0 | GET /user HTTP/1.1 | 200 OK | 354 ms
2024/05/27 10:24:27.791     INFO: [cws.access]  192.168.0.5:0 | GET /user HTTP/1.1 | 200 OK | 495 ms

机器的信息:

Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz
2H2.5G
maxduke commented 1 month ago

看log也都是正常完成的,能复现么?

xixi-furry commented 1 month ago

可以,我刚刚问还是一样的 image

xixi-furry commented 1 month ago

主要是很奇怪,cws没有任何报错,也没有报突然断开什么的,就是不出完直接结束了。

maxduke commented 1 month ago

是回复太长了么? 发我能复现的prompt。我有空看下

xixi-furry commented 1 month ago

塞了代码,可能确实是太长的问题。因为他每次都会重新输出一次,感觉是不是没有办法继续输出,可能原本这里有个继续输出?

maxduke commented 1 month ago

我记得很久前有自动继续,那个我没改动。官网现在是什么样的?

xixi-furry commented 1 month ago

我记得很久前有自动继续,那个我没改动。官网现在是什么样的?

这个就不太清楚了。

maxduke commented 1 month ago

感觉应该就是自动继续的问题。 如果有能复现的prompt我可以去官网看下。

maxduke commented 1 month ago

最新版已修复