Merge pull request #664 from LopeKinz/main

Fix for issue #660
pull/674/head
xtekky 1 year ago committed by GitHub
commit 94412b0dbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -144,10 +144,15 @@ class Completion:
response = Completion.__response_to_json(content)
return response
@classmethod
def __response_to_json(cls, text) -> str:
text = str(text.decode("utf-8"))
split_text = text.rsplit("\n", 1)[1]
to_json = json.loads(split_text)
return to_json
split_text = text.rsplit("\n", 1)
if len(split_text) > 1:
to_json = json.loads(split_text[1])
return to_json
else:
return None

Loading…
Cancel
Save