Created
July 21, 2023 10:38
-
-
Save dzianisv/5ba6dd217d083b9a3de8416c9f940b15 to your computer and use it in GitHub Desktop.
GPT for Free
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import g4f | |
| from g4f.Provider import * | |
| import inspect | |
| providers = [Ails, | |
| You, | |
| Bing, | |
| Yqcloud, | |
| Theb, | |
| Aichat, | |
| Bard, | |
| Vercel, | |
| Forefront, | |
| Lockchat, | |
| Liaobots, | |
| H2o, | |
| ChatgptLogin, | |
| DeepAi, | |
| GetGpt, | |
| AItianhu, | |
| EasyChat, | |
| Acytoo, | |
| DfeHub, | |
| AiService, | |
| BingHuan, | |
| Wewordle, | |
| ChatgptAi | |
| ] | |
| for provider in providers: | |
| try: | |
| response = g4f.ChatCompletion.create(model=g4f.Model.gpt_35_turbo, provider=provider, messages=[ | |
| {"role": "user", "content": "Hello world"}], stream=True) | |
| for message in response: | |
| print(message) | |
| print(f"{provider.__name__} is good") | |
| except Exception as e: | |
| print(f"{provider.__name__} failed with {e}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment