claude-to-chatgpt icon indicating copy to clipboard operation
claude-to-chatgpt copied to clipboard

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

Open Jialinvip opened this issue 1 year ago • 1 comments

以下是日志: { "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 }

Jialinvip avatar Jul 18 '23 15:07 Jialinvip

Thanks to https://github.com/jtsang4/claude-to-chatgpt/pull/27 , you can try it again.

jtsang4 avatar Nov 29 '23 04:11 jtsang4