Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudflare部署时输出不全,大概判断是claude响应穿过来的Json数据块处理不对 #22

Open
Jialinvip opened this issue Jul 18, 2023 · 1 comment

Comments

@Jialinvip
Copy link

以下是日志:
{
"outcome": "ok",
"scriptName": "api",
"diagnosticsChannelEvents": [],
"exceptions": [],
"logs": [
{
"message": [
"Error parsing line:",
"data: {"completion": " \u5bf9", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": "\u4e0d", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: ping\r\ndata: {}\r\n\r\nevent: completion\r\ndata: {"completion": "\u8d77", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": ",", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": "\u6211", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": "\u6ca1\u6709", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}"
],
"level": "error",
"timestamp": 1689694428944
},
{
"message": [
"Error details:",
"SyntaxError: Unexpected non-whitespace character after JSON at position 170"
],
"level": "error",
"timestamp": 1689694428944
},
{
"message": [
"Error parsing line:",
"data: {"completion": "\u4e2d", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\n\r\ndata: {"completion": "\u65ad", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": "\u5bf9", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": "\u8bdd", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": "\u3002", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": "\u8bf7", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": "\u95ee", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}"
],
"level": "error",
"timestamp": 1689694429173
},
{
"message": [
"Error details:",
"SyntaxError: Unexpected non-whitespace character after JSON at position 169"
],
"level": "error",
"timestamp": 1689694429173
},
{
"message": [
"Error parsing line:",
"data: {"completion": "\u4f60", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\n\r\ndata: {"completion": "\u505a", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": "\u4ec0", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": "\u4e48", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": "\u5417", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}\r\n\r\nevent: completion\r\ndata: {"completion": "?", "stop_reason": null, "model": "claude-instant-1.1", "stop": null, "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}"
],
"level": "error",
"timestamp": 1689694429292
},
{
"message": [
"Error details:",
"SyntaxError: Unexpected non-whitespace character after JSON at position 169"
],
"level": "error",
"timestamp": 1689694429292
},
{
"message": [
"Error parsing line:",
"data: {"completion": "", "stop_reason": "stop_sequence", "model": "claude-instant-1.1", "stop": "\n\nHuman:", "log_id": "a90cd1c2e5cd79dc42e5b8370db171dd7560bc1e4992f532b0788bcdc290d385"}"
],
"level": "error",
"timestamp": 1689694429307
},
{
"message": [
"Error details:",
"SyntaxError: Bad control character in string literal in JSON at position 92"
],
"level": "error",
"timestamp": 1689694429307
}
],
"eventTimestamp": 1689694428393,
"event": {
"request": {
"url": "https://api.gptvpn.workers.dev//v1/chat/completions?path=v1%2Fchat%2Fcompletions",
"method": "POST",
"headers": {
"accept-encoding": "gzip",
"authorization": "REDACTED",
"cache-control": "no-store",
"cf-connecting-ip": "2a06:98c0:3600::103",
"cf-ipcountry": "JP",
"cf-ray": "7e8bc90167688a4a",
"cf-visitor": "{"scheme":"https"}",
"cf-worker": "cloudflare-workers.vercel-infra-production.com",
"connection": "Keep-Alive",
"content-length": "462",
"content-type": "application/json",
"host": "api.gptvpn.workers.dev",
"user-agent": "Vercel Edge Functions",
"x-forwarded-proto": "https",
"x-middleware-subrequest": "108e1acb26c5cd85cc0ba1407b11fcd31c80186c",
"x-real-ip": "2a06:98c0:3600::103",
"x-vercel-id": "hnd1::jt2tb-1689694428378-8c075663a13d"
},
"cf": {
"longitude": "139.68990",
"latitude": "35.68930",
"tlsCipher": "",
"continent": "AS",
"asn": 16509,
"country": "JP",
"tlsClientAuth": {
"certIssuerDNLegacy": "",
"certIssuerSKI": "",
"certSubjectDNRFC2253": "",
"certSubjectDNLegacy": "",
"certFingerprintSHA256": "",
"certNotBefore": "",
"certSKI": "",
"certSerial": "",
"certIssuerDN": "",
"certVerified": "NONE",
"certNotAfter": "",
"certSubjectDN": "",
"certPresented": "0",
"certRevoked": "0",
"certIssuerSerial": "",
"certIssuerDNRFC2253": "",
"certFingerprintSHA1": ""
},
"tlsVersion": "",
"colo": "NRT",
"timezone": "Asia/Tokyo",
"city": "Tokyo",
"edgeRequestKeepAliveStatus": 1,
"requestPriority": "",
"httpProtocol": "HTTP/1.1",
"region": "Tokyo",
"regionCode": "13",
"asOrganization": "Amazon.com",
"postalCode": "151-0053",
"botManagement": {
"corporateProxy": false,
"verifiedBot": false,
"jsDetection": {
"passed": false
},
"staticResource": false,
"detectionIds": {},
"score": 99
}
}
},
"response": {
"status": 200
}
},
"id": 7
}

@jtsang4
Copy link
Owner

jtsang4 commented Nov 29, 2023

Thanks to #27 , you can try it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants