返回提交历史
Modified
README.md
+2
-2
Modified
g4f/Provider/Providers/Ails.py
+1
-1
Modified
g4f/Provider/Providers/BingHuan.py
+0
-1
Modified
g4f/Provider/Providers/ChatgptAi.py
+1
-2
Modified
g4f/Provider/__init__.py
+2
-1
Added
testing/test.py
+13
-0
XFEstudio/gpt4free
minor fixes
ails, chatgptai ...
76c7be31
代码差异
6 个文件
+19
-7
@@ -158,10 +158,10 @@ for token in chat_completion:
158
158
| [chat9.yqcloud.top](https://chat9.yqcloud.top/) | `g4f.Provider.Yqcloud` | ✔️ | ❌ | ✔️ |  | ❌ |
159
159
| [theb.ai](https://theb.ai) | `g4f.Provider.Theb` | ✔️ | ❌ | ✔️ |  | ❌ |
160
160
| [play.vercel.ai](https://play.vercel.ai) | `g4f.Provider.Vercel` | ✔️ | ❌ | ✔️ |  | ❌ |
161
| [forefront.com](https://forefront.com) | `g4f.Provider.Forefront` | ✔️ | ❌ | ✔️ |  | ❌ |
161
| [forefront.com](https://forefront.com) | `g4f.Provider.Forefront` | ✔️ | ❌ | ✔️ |  | ❌ |
162
162
| [deepai.org](https://deepai.org) | `g4f.Provider.DeepAi` | ✔️ | ❌ | ✔️ |  | ❌ |
163
163
| [chat.getgpt.world](https://chat.getgpt.world/) | `g4f.Provider.GetGpt` | ✔️ | ❌ | ✔️ |  | ❌ |
164
| [chatgptlogin.ac](https://chatgptlogin.ac) | `g4f.Provider.ChatgptLogin` | ✔️ | ❌ | ❌ |  | ❌ |
164
| [chatgptlogin.ac](https://chatgptlogin.ac) | `g4f.Provider.ChatgptLogin` | ✔️ | ❌ | ❌ |  | ❌ |
165
165
| [chat-gpt.org](https://chat-gpt.org/chat) | `g4f.Provider.Aichat` | ✔️ | ❌ | ❌ |  | ❌ |
166
166
| [chat.acytoo.com](https://chat.acytoo.com) | `g4f.Provider.Acytoo` | ✔️ | ❌ | ❌ |  | ❌ |
167
167
| [aitianhu.com](https://aitianhu.com) | `g4f.Provider.AItianhu` | ✔️ | ❌ | ❌ |  | ❌ |
@@ -45,7 +45,7 @@ def _create_completion(model: str, messages: list, temperature: float = 0.6, str
45
45
'accept-language': 'en,fr-FR;q=0.9,fr;q=0.8,es-ES;q=0.7,es;q=0.6,en-US;q=0.5,am;q=0.4,de;q=0.3',
46
46
'authorization': 'Bearer free',
47
47
'client-id': str(uuid.uuid4()),
48
'client-v': '0.1.217',
48
'client-v': '0.1.249',
49
49
'content-type': 'application/json',
50
50
'origin': 'https://ai.ls',
51
51
'referer': 'https://ai.ls/',
@@ -19,7 +19,6 @@ def _create_completion(model: str, messages: list, stream: bool, **kwargs):
19
19
20
20
for line in iter(p.stdout.readline, b''):
21
21
yield line.decode('cp1252')
22
23
22
24
23
25
24
params = f'g4f.Providers.{os.path.basename(__file__)[:-3]} supports: ' + \
@@ -13,8 +13,7 @@ def _create_completion(model: str, messages: list, stream: bool, **kwargs):
13
13
chat += '%s: %s\n' % (message['role'], message['content'])
14
14
chat += 'assistant: '
15
15
16
response = requests.get('https://chatgpt.ai/gpt-4/')
17
16
response = requests.get('https://chatgpt.ai/')
18
17
nonce, post_id, _, bot_id = re.findall(r'data-nonce="(.*)"\n data-post-id="(.*)"\n data-url="(.*)"\n data-bot-id="(.*)"\n data-width', response.text)[0]
19
18
20
19
headers = {
@@ -21,7 +21,8 @@ from .Providers import (
21
21
DFEHub,
22
22
AiService,
23
23
BingHuan,
24
Wewordle
24
Wewordle,
25
ChatgptAi,
25
26
)
26
27
27
28
Palm = Bard
@@ -0,0 +1,13 @@
1
import g4f
2
3
# Set with provider
4
stream = False
5
response = g4f.ChatCompletion.create(model='gpt-3.5-turbo', provider=g4f.Provider.ChatgptLogin, messages=[
6
{"role": "user", "content": "hello"}], stream=stream)
7
8
if stream:
9
for message in response:
10
print(message)
11
else:
12
print(response)
13