diff options
author | t.me/xtekky <98614666+xtekky@users.noreply.github.com> | 2023-04-30 13:42:21 +0200 |
---|---|---|
committer | t.me/xtekky <98614666+xtekky@users.noreply.github.com> | 2023-04-30 13:42:21 +0200 |
commit | e02094de5baac85613855c8a6c9ae1298324ad0e (patch) | |
tree | f3a8930ffc312c31916b7beeffac3ccc090f929c /unfinished/usesless | |
parent | Update README.md (diff) | |
download | gpt4free-e02094de5baac85613855c8a6c9ae1298324ad0e.tar gpt4free-e02094de5baac85613855c8a6c9ae1298324ad0e.tar.gz gpt4free-e02094de5baac85613855c8a6c9ae1298324ad0e.tar.bz2 gpt4free-e02094de5baac85613855c8a6c9ae1298324ad0e.tar.lz gpt4free-e02094de5baac85613855c8a6c9ae1298324ad0e.tar.xz gpt4free-e02094de5baac85613855c8a6c9ae1298324ad0e.tar.zst gpt4free-e02094de5baac85613855c8a6c9ae1298324ad0e.zip |
Diffstat (limited to '')
-rw-r--r-- | gpt4free/usesless/README.md (renamed from unfinished/usesless/README.md) | 0 | ||||
-rw-r--r-- | gpt4free/usesless/__init__.py (renamed from unfinished/usesless/__init__.py) | 4 |
2 files changed, 4 insertions, 0 deletions
diff --git a/unfinished/usesless/README.md b/gpt4free/usesless/README.md index 13e9df8c..13e9df8c 100644 --- a/unfinished/usesless/README.md +++ b/gpt4free/usesless/README.md 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 |