Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

fix multiple chunk data concatenated #12

Merged
merged 1 commit into from
Apr 9, 2023
Merged

Conversation

nephen
Copy link
Contributor

@nephen nephen commented Apr 9, 2023

看起来是数据没有接收完整,就拿来解析了,所以判断解析失败时,干脆重新读取数据进行重试了。

go-chatgpt-api          | INFO[0833] {"message": {"id": "eb527d07-dd7a-4fa4-a920-083994b9b5ca", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1681030026.950957, "update_time": null, "content": {"content_type": "text", "parts": ["\u5728 Vue \u4e2d\u5b9e\u73b0\u8f93\u5165\u6846\u7f13\u5b58\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\uff1a\n\n1. \u5728\u9875\u9762\u521d\u59cb\u5316\u65f6\uff0c\u901a\u8fc7 localStorage \u6216 sessionStorage \u83b7\u53d6\u8f93\u5165\u6846\u7684\u503c\u3002\n\n2. \u5c06\u8f93\u5165\u6846\u7684\u503c\u7ed1\u5b9a\u5230 data \u4e2d\u7684\u53d8\u91cf\u3002\n\n3. \u76d1\u542c\u8f93\u5165\u6846\u7684 input \u4e8b\u4ef6\uff0c\u6bcf\u6b21\u8f93\u5165\u6846\u7684\u503c\u53d1\u751f\u53d8\u5316\u65f6\uff0c\u5c06\u503c\u66f4\u65b0\u5230 data \u4e2d\u7684\u53d8\u91cf\uff0c\u5e76\u5c06\u53d8\u91cf\u7684\u503c\u4fdd\u5b58\u5230 localStorage \u6216 sessionStorage \u4e2d\u3002\n\n\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a\n\n```\n<template>\n  <div>\n    <input type=\"text\" v-model=\"inputValue\" @input=\"handleInput\" />\n  </div>\n</template>\n\n<script>\nexport default {\n  data() {\n    return {\n
go-chatgpt-api          | ERRO[0833] unexpected end of JSON input

@linweiyuan linweiyuan merged commit f3b6778 into linweiyuan:main Apr 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants