mirror of https://github.com/xtekky/gpt4free.git
Fix: GptGo json.decoder.JSONDecodeError
This commit is contained in:
parent
4829f3bfec
commit
19346ba9ba
|
@ -60,6 +60,8 @@ class GptGo(AsyncGeneratorProvider):
|
|||
if line.startswith("data: [DONE]"):
|
||||
break
|
||||
line = json.loads(line[len(start):-1])
|
||||
if line["choices"][0]["finish_reason"] == "stop":
|
||||
break
|
||||
content = line["choices"][0]["delta"].get("content")
|
||||
if content:
|
||||
yield content
|
||||
|
|
Loading…
Reference in New Issue