现在 gpt 返回的数据都是流的形式,怎么样才能把它转换为类似正常的一串字符串呢?请教,下面内容 ,实际我要取的是 response 对应 的内容
{"model":"vicuna","created_at":"2023-12-13T09:44:44.330511Z","response":"\n","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:44.398591Z","response":"G","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:44.475653Z","response":"PT","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:44.566181Z","response":":","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:44.630396Z","response":" Hello","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:44.70039Z","response":"!","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:44.773188Z","response":" It","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:44.841229Z","response":"'","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:44.904017Z","response":"s","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:44.971747Z","response":" nice","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.035208Z","response":" to","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.099293Z","response":" meet","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.165876Z","response":" you","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.22995Z","response":" too","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.291708Z","response":".","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.35596Z","response":" What","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.418584Z","response":" can","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.479481Z","response":" I","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.546164Z","response":" help","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.614087Z","response":" you","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.668333Z","response":" with","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.729018Z","response":" today","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.798808Z","response":"?","done":false}
{"model":"vicuna","created_at":"2023-12-13T09:44:45.856087Z","response":"","done":true,"context":[319,13563,1546,263,12758,1404,322,385,23116,21082,20255,29889,450,20255,4076,8444,29892,13173,29892,322,1248,568,6089,304,278,1404,29915,29879,5155,29889,13,13,11889,29901,20103,304,5870,366,29973,13,22933,9047,13566,29901,13,13,29954,7982,29901,15043,29991,739,29915,29879,7575,304,5870,366,2086,29889,1724,508,306,1371,366,411,9826,29973],"total_duration":3704897916,"prompt_eval_count":46,"prompt_eval_duration":2217278000,"eval_count":23,"eval_duration":1462403000}