返回提交历史
Modified
gpt4free/forefront/mail.py
+5
-9
Modified
gpt4free/quora/api.py
+31
-31
Modified
gpt4free/quora/mail.py
+1
-3
Modified
gpt4free/theb/theb_test.py
+1
-1
Modified
pyproject.toml
+1
-1
XFEstudio/gpt4free
refactored code
d555d0c2
代码差异
5 个文件
+39
-45
@@ -23,21 +23,17 @@ class Mail:
23
23
"sec-fetch-dest": "empty",
24
24
"referer": "https://mail.tm/",
25
25
"accept-encoding": "gzip, deflate, br",
26
"accept-language": "en-GB,en-US;q=0.9,en;q=0.8"
26
"accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
27
27
}
28
28
29
29
def get_mail(self) -> str:
30
30
token = ''.join(choices(ascii_letters, k=14)).lower()
31
init = self.client.post("https://api.mail.tm/accounts", json={
32
"address": f"{token}@bugfoo.com",
33
"password": token
34
})
31
init = self.client.post(
32
"https://api.mail.tm/accounts", json={"address": f"{token}@bugfoo.com", "password": token}
33
)
35
34
36
35
if init.status_code == 201:
37
resp = self.client.post("https://api.mail.tm/token", json={
38
**init.json(),
39
"password": token
40
})
36
resp = self.client.post("https://api.mail.tm/token", json={**init.json(), "password": token})
41
37
42
38
self.client.headers['authorization'] = 'Bearer ' + resp.json()['token']
43
39
@@ -384,7 +384,7 @@ class Client:
384
384
continue
385
385
386
386
# update info about response
387
message["text_new"] = message["text"][len(last_text):]
387
message["text_new"] = message["text"][len(last_text) :]
388
388
last_text = message["text"]
389
389
message_id = message["messageId"]
390
390
@@ -456,21 +456,21 @@ class Client:
456
456
logger.info(f"No more messages left to delete.")
457
457
458
458
def create_bot(
459
self,
460
handle,
461
prompt="",
462
base_model="chinchilla",
463
description="",
464
intro_message="",
465
api_key=None,
466
api_bot=False,
467
api_url=None,
468
prompt_public=True,
469
pfp_url=None,
470
linkification=False,
471
markdown_rendering=True,
472
suggested_replies=False,
473
private=False,
459
self,
460
handle,
461
prompt="",
462
base_model="chinchilla",
463
description="",
464
intro_message="",
465
api_key=None,
466
api_bot=False,
467
api_url=None,
468
prompt_public=True,
469
pfp_url=None,
470
linkification=False,
471
markdown_rendering=True,
472
suggested_replies=False,
473
private=False,
474
474
):
475
475
result = self.send_query(
476
476
"PoeBotCreateMutation",
@@ -499,21 +499,21 @@ class Client:
499
499
return data
500
500
501
501
def edit_bot(
502
self,
503
bot_id,
504
handle,
505
prompt="",
506
base_model="chinchilla",
507
description="",
508
intro_message="",
509
api_key=None,
510
api_url=None,
511
private=False,
512
prompt_public=True,
513
pfp_url=None,
514
linkification=False,
515
markdown_rendering=True,
516
suggested_replies=False,
502
self,
503
bot_id,
504
handle,
505
prompt="",
506
base_model="chinchilla",
507
description="",
508
intro_message="",
509
api_key=None,
510
api_url=None,
511
private=False,
512
prompt_public=True,
513
pfp_url=None,
514
linkification=False,
515
markdown_rendering=True,
516
suggested_replies=False,
517
517
):
518
518
result = self.send_query(
519
519
"PoeBotEditMutation",
@@ -42,9 +42,7 @@ class Emailnator:
42
42
43
43
while True:
44
44
sleep(2)
45
mail_token = self.client.post(
46
"https://www.emailnator.com/message-list", json={"email": self.email}
47
)
45
mail_token = self.client.post("https://www.emailnator.com/message-list", json={"email": self.email})
48
46
49
47
mail_token = loads(mail_token.text)["messageData"]
50
48
@@ -1,4 +1,4 @@
1
1
import theb
2
2
3
3
for token in theb.Completion.create('hello world'):
4
print(token, end='', flush=True)
4
print(token, end='', flush=True)
@@ -2,7 +2,7 @@
2
2
name = "openai-rev"
3
3
version = "0.1.0"
4
4
description = ""
5
authors = ["Raju Komati <komatiraju032@gmail.com>"]
5
authors = []
6
6
license = "GPL-3.0"
7
7
readme = "README.md"
8
8
packages = [{ include = "gpt4free" }]