summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaju Komati <komatiraju032@gmail.com>2023-04-29 12:20:18 +0200
committerRaju Komati <komatiraju032@gmail.com>2023-04-29 12:20:18 +0200
commitd555d0c247498afe97fdc37f20eb8481e432db60 (patch)
tree4a4f9315dfea90c6431e15a0db6f2af0d7832592
parentadded readme for gpt4 module (diff)
downloadgpt4free-d555d0c247498afe97fdc37f20eb8481e432db60.tar
gpt4free-d555d0c247498afe97fdc37f20eb8481e432db60.tar.gz
gpt4free-d555d0c247498afe97fdc37f20eb8481e432db60.tar.bz2
gpt4free-d555d0c247498afe97fdc37f20eb8481e432db60.tar.lz
gpt4free-d555d0c247498afe97fdc37f20eb8481e432db60.tar.xz
gpt4free-d555d0c247498afe97fdc37f20eb8481e432db60.tar.zst
gpt4free-d555d0c247498afe97fdc37f20eb8481e432db60.zip
-rw-r--r--gpt4free/forefront/mail.py14
-rw-r--r--gpt4free/quora/api.py62
-rw-r--r--gpt4free/quora/mail.py4
-rw-r--r--gpt4free/theb/theb_test.py2
-rw-r--r--pyproject.toml2
5 files changed, 39 insertions, 45 deletions
diff --git a/gpt4free/forefront/mail.py b/gpt4free/forefront/mail.py
index 41c2a647..2c00051c 100644
--- a/gpt4free/forefront/mail.py
+++ b/gpt4free/forefront/mail.py
@@ -23,21 +23,17 @@ class Mail:
"sec-fetch-dest": "empty",
"referer": "https://mail.tm/",
"accept-encoding": "gzip, deflate, br",
- "accept-language": "en-GB,en-US;q=0.9,en;q=0.8"
+ "accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
}
def get_mail(self) -> str:
token = ''.join(choices(ascii_letters, k=14)).lower()
- init = self.client.post("https://api.mail.tm/accounts", json={
- "address": f"{token}@bugfoo.com",
- "password": token
- })
+ init = self.client.post(
+ "https://api.mail.tm/accounts", json={"address": f"{token}@bugfoo.com", "password": token}
+ )
if init.status_code == 201:
- resp = self.client.post("https://api.mail.tm/token", json={
- **init.json(),
- "password": token
- })
+ resp = self.client.post("https://api.mail.tm/token", json={**init.json(), "password": token})
self.client.headers['authorization'] = 'Bearer ' + resp.json()['token']
diff --git a/gpt4free/quora/api.py b/gpt4free/quora/api.py
index c48eb273..897215a8 100644
--- a/gpt4free/quora/api.py
+++ b/gpt4free/quora/api.py
@@ -384,7 +384,7 @@ class Client:
continue
# update info about response
- message["text_new"] = message["text"][len(last_text):]
+ message["text_new"] = message["text"][len(last_text) :]
last_text = message["text"]
message_id = message["messageId"]
@@ -456,21 +456,21 @@ class Client:
logger.info(f"No more messages left to delete.")
def create_bot(
- self,
- handle,
- prompt="",
- base_model="chinchilla",
- description="",
- intro_message="",
- api_key=None,
- api_bot=False,
- api_url=None,
- prompt_public=True,
- pfp_url=None,
- linkification=False,
- markdown_rendering=True,
- suggested_replies=False,
- private=False,
+ self,
+ handle,
+ prompt="",
+ base_model="chinchilla",
+ description="",
+ intro_message="",
+ api_key=None,
+ api_bot=False,
+ api_url=None,
+ prompt_public=True,
+ pfp_url=None,
+ linkification=False,
+ markdown_rendering=True,
+ suggested_replies=False,
+ private=False,
):
result = self.send_query(
"PoeBotCreateMutation",
@@ -499,21 +499,21 @@ class Client:
return data
def edit_bot(
- self,
- bot_id,
- handle,
- prompt="",
- base_model="chinchilla",
- description="",
- intro_message="",
- api_key=None,
- api_url=None,
- private=False,
- prompt_public=True,
- pfp_url=None,
- linkification=False,
- markdown_rendering=True,
- suggested_replies=False,
+ self,
+ bot_id,
+ handle,
+ prompt="",
+ base_model="chinchilla",
+ description="",
+ intro_message="",
+ api_key=None,
+ api_url=None,
+ private=False,
+ prompt_public=True,
+ pfp_url=None,
+ linkification=False,
+ markdown_rendering=True,
+ suggested_replies=False,
):
result = self.send_query(
"PoeBotEditMutation",
diff --git a/gpt4free/quora/mail.py b/gpt4free/quora/mail.py
index e6ce96c2..864d9568 100644
--- a/gpt4free/quora/mail.py
+++ b/gpt4free/quora/mail.py
@@ -42,9 +42,7 @@ class Emailnator:
while True:
sleep(2)
- mail_token = self.client.post(
- "https://www.emailnator.com/message-list", json={"email": self.email}
- )
+ mail_token = self.client.post("https://www.emailnator.com/message-list", json={"email": self.email})
mail_token = loads(mail_token.text)["messageData"]
diff --git a/gpt4free/theb/theb_test.py b/gpt4free/theb/theb_test.py
index 177c970a..c57d5c62 100644
--- a/gpt4free/theb/theb_test.py
+++ b/gpt4free/theb/theb_test.py
@@ -1,4 +1,4 @@
import theb
for token in theb.Completion.create('hello world'):
- print(token, end='', flush=True) \ No newline at end of file
+ print(token, end='', flush=True)
diff --git a/pyproject.toml b/pyproject.toml
index 7c2244f5..83df5dc5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -2,7 +2,7 @@
name = "openai-rev"
version = "0.1.0"
description = ""
-authors = ["Raju Komati <komatiraju032@gmail.com>"]
+authors = []
license = "GPL-3.0"
readme = "README.md"
packages = [{ include = "gpt4free" }]