diff options
Diffstat (limited to '')
-rw-r--r-- | gpt4free/usesless/__init__.py (renamed from unfinished/usesless/__init__.py) | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/unfinished/usesless/__init__.py b/gpt4free/usesless/__init__.py index 6f9a47ef..6029009d 100644 --- a/unfinished/usesless/__init__.py +++ b/gpt4free/usesless/__init__.py @@ -23,6 +23,8 @@ class Completion: temperature: float = 1, model: str = "gpt-3.5-turbo", ): + print(parentMessageId, prompt) + json_data = { "openaiKey": "", "prompt": prompt, @@ -40,12 +42,14 @@ class Completion: url = "https://ai.usesless.com/api/chat-process" request = requests.post(url, headers=Completion.headers, json=json_data) content = request.content + response = Completion.__response_to_json(content) return response @classmethod def __response_to_json(cls, text) -> dict: text = str(text.decode("utf-8")) + split_text = text.rsplit("\n", 1)[1] to_json = json.loads(split_text) return to_json |