返回提交历史
Modified
README.md
+50
-28
Modified
tool/readme_table.py
+3
-3
XFEstudio/gpt4free
Update Readme
d076909c
代码差异
2 个文件
+53
-31
@@ -182,13 +182,17 @@ for message in response:
182
182
##### Providers:
183
183
```py
184
184
from g4f.Provider import (
185
AItianhu,
185
186
Acytoo,
186
187
Aichat,
187
188
Ails,
189
Aivvm,
188
190
Bard,
189
191
Bing,
192
ChatBase,
190
193
ChatgptAi,
191
194
ChatgptLogin,
195
CodeLinkAva,
192
196
DeepAi,
193
197
EasyChat,
194
198
Equing,
@@ -201,23 +205,23 @@ from g4f.Provider import (
201
205
Raycast,
202
206
Theb,
203
207
Vercel,
208
Vitalentum,
204
209
Wewordle,
205
210
Wuguokai,
211
Ylokh,
206
212
You,
207
Yqcloud
213
Yqcloud,
208
214
)
209
215
# Usage:
210
216
response = g4f.ChatCompletion.create(..., provider=ProviderName)
211
217
```
212
218
213
##### Needs cookies:
219
##### Cookies Required:
220
221
Cookies are essential for the proper functioning of many service providers. When using Bing, it's necessary to have a session where you have successfully passed the captcha. For other providers, logging into your account is a prerequisite.
222
223
When running the g4f package locally, the package automatically retrieves cookies from your web browser using the `get_cookies` function. However, if you're not running it locally, you'll need to provide the cookies manually by passing them as parameters using the `cookies` parameter.
214
224
215
Many providers need cookies to work.
216
In Bing you need a session, where you have passed the captcha.
217
And in others providers you have to log-in into your account.
218
If you run the g4l package locally,
219
cookies from your browsers are read with `get_cookies`.
220
Else you have pass them in the parameter `cookies`:
221
225
```py
222
226
import g4f
223
227
from g4f.Provider import (
@@ -240,23 +244,36 @@ response = g4f.ChatCompletion.create(
240
244
)
241
245
```
242
246
243
##### Async support:
247
##### Async Support:
244
248
245
Run providers `async` to improve speed / performance.
246
The full execution time corresponds to the execution time of the slowest provider.
249
To enhance speed and overall performance, execute providers asynchronously. The total execution time will be determined by the duration of the slowest provider's execution.
247
250
248
251
```py
249
252
import g4f, asyncio
250
253
251
254
async def run_async():
252
255
_providers = [
256
g4f.Provider.AItianhu,
257
g4f.Provider.Acytoo,
258
g4f.Provider.Aichat,
259
g4f.Provider.Ails,
260
g4f.Provider.Aivvm,
253
261
g4f.Provider.Bard,
254
262
g4f.Provider.Bing,
263
g4f.Provider.ChatBase,
264
g4f.Provider.ChatgptAi,
265
g4f.Provider.ChatgptLogin,
266
g4f.Provider.CodeLinkAva,
267
g4f.Provider.DeepAi,
255
268
g4f.Provider.H2o,
256
269
g4f.Provider.HuggingChat,
257
g4f.Provider.Liaobots,
270
g4f.Provider.Opchatgpts,
258
271
g4f.Provider.OpenAssistant,
259
272
g4f.Provider.OpenaiChat,
273
g4f.Provider.Vercel,
274
g4f.Provider.Vitalentum,
275
g4f.Provider.Wewordle,
276
g4f.Provider.Ylokh,
260
277
g4f.Provider.You,
261
278
g4f.Provider.Yqcloud,
262
279
]
@@ -323,31 +340,36 @@ if __name__ == "__main__":
323
340
324
341
| Website| Provider| gpt-3.5 | gpt-4 | Streaming | Status | Auth |
325
342
| ------ | ------- | ------- | ----- | --------- | ------ | ---- |
326
| [chat.acytoo.com](https://chat.acytoo.com/) | g4f.provider.Acytoo | ✔️ | ❌ | ❌ |  | ❌ |
343
| [www.aitianhu.com](https://www.aitianhu.com) | g4f.provider.AItianhu | ✔️ | ❌ | ✔️ |  | ❌ |
344
| [chat.acytoo.com](https://chat.acytoo.com) | g4f.provider.Acytoo | ✔️ | ❌ | ✔️ |  | ❌ |
327
345
| [chat-gpt.org](https://chat-gpt.org/chat) | g4f.provider.Aichat | ✔️ | ❌ | ❌ |  | ❌ |
328
| [ai.ls](https://ai.ls) | g4f.provider.Ails | ✔️ | ❌ | ✔️ |  | ❌ |
346
| [ai.ls](https://ai.ls) | g4f.provider.Ails | ✔️ | ❌ | ✔️ |  | ❌ |
347
| [chat.aivvm.com](https://chat.aivvm.com) | g4f.provider.Aivvm | ✔️ | ✔️ | ✔️ |  | ❌ |
329
348
| [bard.google.com](https://bard.google.com) | g4f.provider.Bard | ❌ | ❌ | ❌ |  | ✔️ |
330
| [bing.com](https://bing.com/chat) | g4f.provider.Bing | ❌ | ✔️ | ✔️ |  | ✔️ |
331
| [chatgpt.ai](https://chatgpt.ai/gpt-4/) | g4f.provider.ChatgptAi | ❌ | ✔️ | ❌ |  | ❌ |
332
| [opchatgpts.net](https://opchatgpts.net) | g4f.provider.ChatgptLogin | ✔️ | ❌ | ❌ |  | ❌ |
349
| [bing.com](https://bing.com/chat) | g4f.provider.Bing | ❌ | ✔️ | ✔️ |  | ❌ |
350
| [www.chatbase.co](https://www.chatbase.co) | g4f.provider.ChatBase | ✔️ | ✔️ | ✔️ |  | ❌ |
351
| [chatgpt.ai](https://chatgpt.ai/) | g4f.provider.ChatgptAi | ✔️ | ❌ | ✔️ |  | ❌ |
352
| [opchatgpts.net](https://opchatgpts.net) | g4f.provider.ChatgptLogin | ✔️ | ❌ | ❌ |  | ❌ |
353
| [ava-ai-ef611.web.app](https://ava-ai-ef611.web.app) | g4f.provider.CodeLinkAva | ✔️ | ❌ | ✔️ |  | ❌ |
333
354
| [deepai.org](https://deepai.org) | g4f.provider.DeepAi | ✔️ | ❌ | ✔️ |  | ❌ |
334
355
| [free.easychat.work](https://free.easychat.work) | g4f.provider.EasyChat | ✔️ | ❌ | ✔️ |  | ❌ |
335
356
| [next.eqing.tech](https://next.eqing.tech/) | g4f.provider.Equing | ✔️ | ❌ | ✔️ |  | ❌ |
336
| [chat.getgpt.world](https://chat.getgpt.world/) | g4f.provider.GetGpt | ✔️ | ❌ | ✔️ |  | ❌ |
357
| [chat.getgpt.world](https://chat.getgpt.world/) | g4f.provider.GetGpt | ✔️ | ❌ | ✔️ |  | ❌ |
337
358
| [gpt-gm.h2o.ai](https://gpt-gm.h2o.ai) | g4f.provider.H2o | ❌ | ❌ | ✔️ |  | ❌ |
338
| [huggingface.co](https://huggingface.co/chat/) | g4f.provider.HuggingChat | ❌ | ❌ | ❌ |  | ✔️ |
339
| [liaobots.com](https://liaobots.com) | g4f.provider.Liaobots | ✔️ | ✔️ | ✔️ |  | ❌ |
340
| [opchatgpts.net](https://opchatgpts.net) | g4f.provider.Opchatgpts | ✔️ | ❌ | ❌ |  | ❌ |
341
| [open-assistant.io](https://open-assistant.io/chat) | g4f.provider.OpenAssistant | ❌ | ❌ | ❌ |  | ✔️ |
342
| [chat.openai.com](https://chat.openai.com) | g4f.provider.OpenaiChat | ✔️ | ✔️ | ✔️ |  | ✔️ |
359
| [huggingface.co](https://huggingface.co/chat/) | g4f.provider.HuggingChat | ❌ | ❌ | ✔️ |  | ✔️ |
360
| [liaobots.com](https://liaobots.com) | g4f.provider.Liaobots | ✔️ | ✔️ | ✔️ |  | ❌ |
361
| [opchatgpts.net](https://opchatgpts.net) | g4f.provider.Opchatgpts | ✔️ | ❌ | ❌ |  | ❌ |
362
| [open-assistant.io](https://open-assistant.io/chat) | g4f.provider.OpenAssistant | ❌ | ❌ | ✔️ |  | ✔️ |
363
| [chat.openai.com](https://chat.openai.com) | g4f.provider.OpenaiChat | ✔️ | ❌ | ❌ |  | ✔️ |
343
364
| [raycast.com](https://raycast.com) | g4f.provider.Raycast | ✔️ | ✔️ | ✔️ |  | ✔️ |
344
365
| [theb.ai](https://theb.ai) | g4f.provider.Theb | ✔️ | ❌ | ✔️ |  | ✔️ |
345
| [play.vercel.ai](https://play.vercel.ai) | g4f.provider.Vercel | ✔️ | ❌ | ❌ |  | ❌ |
346
| [wewordle.org](https://wewordle.org/) | g4f.provider.Wewordle | ✔️ | ❌ | ❌ |  | ❌ |
366
| [sdk.vercel.ai](https://sdk.vercel.ai) | g4f.provider.Vercel | ✔️ | ❌ | ❌ |  | ❌ |
367
| [app.vitalentum.io](https://app.vitalentum.io) | g4f.provider.Vitalentum | ✔️ | ❌ | ✔️ |  | ❌ |
368
| [wewordle.org](https://wewordle.org) | g4f.provider.Wewordle | ✔️ | ❌ | ❌ |  | ❌ |
347
369
| [chat.wuguokai.xyz](https://chat.wuguokai.xyz) | g4f.provider.Wuguokai | ✔️ | ❌ | ❌ |  | ❌ |
348
| [you.com](https://you.com) | g4f.provider.You | ✔️ | ❌ | ✔️ |  | ❌ |
349
| [chat9.yqcloud.top](https://chat9.yqcloud.top/) | g4f.provider.Yqcloud | ✔️ | ❌ | ❌ |  | ❌ |
350
| [www.aitianhu.com](https://www.aitianhu.com/) | g4f.provider.AItianhu | ✔️ | ❌ | ❌ |  | ❌ |
370
| [chat.ylokh.xyz](https://chat.ylokh.xyz) | g4f.provider.Ylokh | ✔️ | ❌ | ✔️ |  | ❌ |
371
| [you.com](https://you.com) | g4f.provider.You | ✔️ | ❌ | ❌ |  | ❌ |
372
| [chat9.yqcloud.top](https://chat9.yqcloud.top/) | g4f.provider.Yqcloud | ✔️ | ❌ | ✔️ |  | ❌ |
351
373
| [aiservice.vercel.app](https://aiservice.vercel.app/) | g4f.provider.AiService | ✔️ | ❌ | ❌ |  | ❌ |
352
374
| [chat.dfehub.com](https://chat.dfehub.com/) | g4f.provider.DfeHub | ✔️ | ❌ | ✔️ |  | ❌ |
353
375
| [chat9.fastgpt.me](https://chat9.fastgpt.me/) | g4f.provider.FastGpt | ✔️ | ❌ | ✔️ |  | ❌ |
@@ -26,11 +26,11 @@ def print_imports():
26
26
def print_async():
27
27
print("##### Async support:")
28
28
print("```py")
29
print("from g4f.Provider import (")
29
print("_providers = [")
30
30
for _provider in get_providers():
31
31
if issubclass(_provider, AsyncProvider):
32
print(f" {_provider.__name__},")
33
print(")")
32
print(f" g4f.Provider.{_provider.__name__},")
33
print("]")
34
34
print("```")
35
35
print()
36
36
print()