Skip to content

Commit a3696a6

Browse files
committed
- Add utility commands utils gpt4free update etc
- Support g4f-based non-working providers. - Drop restriction to specific `g4f` dependency version (#14 (comment)) - Pass auth value to g4f-based providers. `-k` - Support proxying in g4f providers
1 parent c90c6dc commit a3696a6

File tree

8 files changed

+499
-100
lines changed

8 files changed

+499
-100
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,5 @@ cython_debug/
164164
*recons
165165
README.md
166166
*.txt
167-
test_working_models.py
167+
test-*.py
168+
make-*.py

docs/CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,14 @@ Assume role of the LLM and give your response.*
244244
</details>
245245

246246
- **Aura** is the default provider
247-
- Other minor fixes.
247+
- Other minor fixes.
248+
249+
## v0.3.2
250+
251+
**What's new?**
252+
253+
- Add utility commands `utils` `gpt4free` `update` etc
254+
- Support g4f-based non-working providers.
255+
- Drop restriction to specific `g4f` dependency version (https://github.com/Simatwa/python-tgpt/issues/14#issuecomment-1899468911)
256+
- Pass auth value to g4f-based providers. `-k`
257+
- Support proxying in g4f providers

docs/README.md

Lines changed: 154 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<a href="https://github.com/Simatwa/python-tgpt/actions/workflows/python-test.yml"><img src="https://github.com/Simatwa/python-tgpt/actions/workflows/python-test.yml/badge.svg" alt="Python Test"/></a>
99
-->
1010
<a href="https://github.com/Simatwa/python-tgpt/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/static/v1?logo=GPL&color=Blue&message=MIT&label=License"/></a>
11-
<a href="https://pypi.org/project/python-tgpt"><img alt="PyPi" src="https://img.shields.io/static/v1?logo=pypi&label=Pypi&message=0.3.1&color=green"/></a>
11+
<a href="https://pypi.org/project/python-tgpt"><img alt="PyPi" src="https://img.shields.io/static/v1?logo=pypi&label=Pypi&message=0.3.2&color=green"/></a>
1212
<a href="https://github.com/psf/black"><img alt="Black" src="https://img.shields.io/static/v1?logo=Black&label=Code-style&message=Black"/></a>
1313
<a href="#"><img alt="Passing" src="https://img.shields.io/static/v1?logo=Docs&label=Docs&message=Passing&color=green"/></a>
1414
<a href="https://github.com/Simatwa/python-tgpt/actions/workflows/python-package.yml"><img alt="Python Package flow" src="https://github.com/Simatwa/python-tgpt/actions/workflows/python-package.yml/badge.svg?branch=master"/></a>
@@ -42,7 +42,7 @@ python-tgpt
4242

4343
This project enables seamless interaction with over **45 free LLMs** without requiring an API Key.
4444

45-
The name *python-tgpt* draws inspiration from its parent project [tgpt](https://github.com/aandrew-me/tgpt), which operates on [Golang](https://go.dev/). Through this Python adaptation, users can effortlessly engage with a number of free LLMs available as well as OpenAI's Chapytgpt models, fostering a smoother AI interaction experience.
45+
The name *python-tgpt* draws inspiration from its parent project [tgpt](https://github.com/aandrew-me/tgpt), which operates on [Golang](https://go.dev/). Through this Python adaptation, users can effortlessly engage with a number of free LLMs available, fostering a smoother AI interaction experience.
4646

4747
### Features
4848

@@ -54,7 +54,7 @@ The name *python-tgpt* draws inspiration from its parent project [tgpt](https://
5454
- 🌊 Stream and non-stream response
5555
- 🚀 Ready to use (No API key required)
5656
- ⛓️ Chained requests via proxy
57-
- 🤖 Pass [awesome-chapytgpt prompts](https://github.com/f/awesome-chapytgpt-prompts) easily
57+
- 🤖 Pass [awesome-chatgpt prompts](https://github.com/f/awesome-chatgpt-prompts) easily
5858
- 🧠 Multiple LLM providers - **45+**
5959

6060
## Providers
@@ -73,50 +73,148 @@ These are simply the hosts of the LLMs, which include:
7373

7474
<summary>
7575

76-
+ 41 Other models proudly offered by [gpt4free](https://github.com/xtekky/gpt4free).
76+
41+ Other models proudly offered by [gpt4free](https://github.com/xtekky/gpt4free).
7777

7878
</summary>
7979

8080
- AiChatOnline
81-
- Aura
82-
- Bard
83-
- Bing
84-
- ChatBase
85-
- ChatForAi
86-
- Chatgpt4Online
87-
- ChatgptAi
88-
- ChatgptDemo
89-
- ChatgptNext
90-
- Chatxyz
91-
- DeepInfra
92-
- FakeGpt
93-
- FreeChatgpt
94-
- GPTalk
95-
- GeekGpt
96-
- GeminiProChat
81+
- [Aura](https://openchat.team)
82+
- [Bard](https://bard.google.com/)
83+
- [Bing](https://bing.com)
84+
- [ChatBase](https://www.chatbase.co/)
85+
- [ChatForAi](https://chatforai.store/)
86+
- [Chatgpt4Online](https://chatgpt4online.org)
87+
- [ChatgptAi](https://chatgpt.ai/)
88+
- [ChatgptDemo](ChatgptDemo https://chat.chatgptdemo.net)
89+
- [ChatgptNext](https://www.chatgpt-free.c)
90+
- [Chatxyz](https://chat.3211000.xyz)
91+
- [DeepInfra](https://deepinfra.co)
92+
- [FakeGpt](https://chat-shared2.zhile.io/)
93+
- [FreeChatgpt](https://free.chatgpt.org.uk)
94+
- [GPTalk](https://gptalk.net/)
95+
- [GeekGpt](https://chat.geekgpt.org)
96+
- [GeminiProChat](https://geminiprochat.com)
9797
- Gpt6
98-
- GptChatly
99-
- GptForLove
100-
- GptGo
98+
- [GptChatly](https://gptchatly.com)
99+
- [GptForLove](https://ai18.gptforlove.com/)
100+
- [GptGo](https://gptgo.ai/)
101101
- GptTalkRu
102-
- Hashnode
103-
- HuggingChat
102+
- [Hashnode](https://hashnode.com/)
103+
- [HuggingChat](https://huggingface.co/chat)
104104
- Koala
105-
- Liaobots
106-
- Llama2
107-
- MyShell
105+
- [Liaobots](https://liaobots.site)
106+
- [Llama2](https://www.llama2.ai/)
107+
- [MyShell](https://app.myshell.ai/chat)
108108
- OnlineGpt
109109
- OpenaiChat
110110
- PerplexityAi
111-
- Phind
111+
- [Phind](https://www.phind.com)
112112
- Pi
113113
- Poe
114-
- Raycast
114+
- [Raycast](https://raycast.com)
115115
- TalkAi
116-
- Theb
116+
- [Theb](https://theb.ai/)
117117
- ThebApi
118-
- You
119-
- Yqcloud
118+
- [You](https://you.com/)
119+
- [Yqcloud](https://chat9.yqcloud.top/)
120+
121+
<details>
122+
123+
<summary>
124+
125+
All models. *(Include not working)*
126+
127+
</summary>
128+
129+
1 [AItianhu](https://www.aitianhu.com)
130+
2 [AItianhuSpace](https://chat3.aiyunos.top/)
131+
3 [Acytoo](https://chat.acytoo.com)
132+
4 [AiAsk](https://e.aiask.me)
133+
5 [AiChatOnline](https://aichatonline.org)
134+
6 [AiChatting](https://www.aichatting.net)
135+
7 [AiService](https://aiservice.vercel.app/)
136+
8 [Aibn](https://aibn.cc)
137+
9 [Aichat](https://chat-gpt.org/chat)
138+
10 [Ails](https://ai.ls)
139+
11 [Aivvm](https://chat.aivvm.com)
140+
12 AsyncGeneratorProvider
141+
13 AsyncProvider
142+
14 [Aura](https://openchat.team)
143+
15 [Bard](https://bard.google.com)
144+
16 BaseProvider
145+
17 [Berlin](https://ai.berlin4h.top)
146+
18 [Bestim](https://chatgpt.bestim.org)
147+
19 [Bing](https://bing.com/chat)
148+
20 [ChatAiGpt](https://chataigpt.org)
149+
21 [ChatAnywhere](https://chatanywhere.cn)
150+
22 [ChatBase](https://www.chatbase.co)
151+
23 [ChatForAi](https://chatforai.store)
152+
24 [Chatgpt4Online](https://chatgpt4online.org)
153+
25 [ChatgptAi](https://chatgpt.ai)
154+
26 [ChatgptDemo](https://chat.chatgptdemo.net)
155+
27 [ChatgptDemoAi](https://chat.chatgptdemo.ai)
156+
28 [ChatgptDuo](https://chatgptduo.com)
157+
29 [ChatgptFree](https://chatgptfree.ai)
158+
30 [ChatgptLogin](https://chatgptlogin.ai)
159+
31 [ChatgptNext](https://www.chatgpt-free.cc)
160+
32 [ChatgptX](https://chatgptx.de)
161+
33 [Chatxyz](https://chat.3211000.xyz)
162+
34 [CodeLinkAva](https://ava-ai-ef611.web.app)
163+
35 CreateImagesProvider
164+
36 [Cromicle](https://cromicle.top)
165+
37 [DeepInfra](https://deepinfra.com)
166+
38 [DfeHub](https://chat.dfehub.com/)
167+
39 [EasyChat](https://free.easychat.work)
168+
40 [Equing](https://next.eqing.tech/)
169+
41 [FakeGpt](https://chat-shared2.zhile.io)
170+
42 [FastGpt](https://chat9.fastgpt.me/)
171+
43 [Forefront](https://forefront.com)
172+
44 [FreeChatgpt](https://free.chatgpt.org.uk)
173+
45 [FreeGpt](https://freegpts1.aifree.site/)
174+
46 [GPTalk](https://gptalk.net)
175+
47 [GeekGpt](https://chat.geekgpt.org)
176+
48 [GeminiProChat](https://geminiprochat.com)
177+
49 [GetGpt](https://chat.getgpt.world/)
178+
50 [Gpt6](https://gpt6.ai)
179+
51 [GptChatly](https://gptchatly.com)
180+
52 [GptForLove](https://ai18.gptforlove.com)
181+
53 [GptGo](https://gptgo.ai)
182+
54 [GptGod](https://gptgod.site)
183+
55 [GptTalkRu](https://gpttalk.ru)
184+
56 [H2o](https://gpt-gm.h2o.ai)
185+
57 [Hashnode](https://hashnode.com)
186+
58 [HuggingChat](https://huggingface.co/chat)
187+
59 [Koala](https://koala.sh)
188+
60 [Komo](https://komo.ai/api/ask)
189+
61 [Liaobots](https://liaobots.site)
190+
62 [Llama2](https://www.llama2.ai)
191+
63 [Lockchat](http://supertest.lockchat.app)
192+
64 [MikuChat](https://ai.okmiku.com)
193+
65 [MyShell](https://app.myshell.ai/chat)
194+
66 [Myshell](https://app.myshell.ai/chat)
195+
67 [OnlineGpt](https://onlinegpt.org)
196+
68 [Opchatgpts](https://opchatgpts.net)
197+
69 [OpenAssistant](https://open-assistant.io/chat)
198+
70 [OpenaiChat](https://chat.openai.com)
199+
71 [PerplexityAi](https://www.perplexity.ai)
200+
72 [Phind](https://www.phind.com)
201+
73 [Pi](https://pi.ai/talk)
202+
74 [Poe](https://poe.com)
203+
75 [Raycast](https://raycast.com)
204+
76 RetryProvider
205+
77 [TalkAi](https://talkai.info)
206+
78 [Theb](https://beta.theb.ai)
207+
79 [ThebApi](https://theb.ai)
208+
80 [V50](https://p5.v50.ltd)
209+
81 [Vercel](https://sdk.vercel.ai)
210+
82 [Vitalentum](https://app.vitalentum.io)
211+
83 [Wewordle](https://wewordle.org)
212+
84 [Wuguokai](https://chat.wuguokai.xyz)
213+
85 [Ylokh](https://chat.ylokh.xyz)
214+
86 [You](https://you.com)
215+
87 [Yqcloud](https://chat9.yqcloud.top/)
216+
217+
</details>
120218

121219
</details>
122220

@@ -331,9 +429,6 @@ bot = bard.BARD('<Path-to-bard.google.com.cookies.json>')
331429
print(bot.chat("<Your-prompt>"))
332430
```
333431

334-
</details>
335-
336-
337432
</details>
338433

339434
<details>
@@ -352,7 +447,6 @@ print(bot.chat("<Your-prompt>"))
352447

353448
</details>
354449

355-
356450
</details>
357451

358452
<details>
@@ -400,8 +494,31 @@ $ git diff | pytgpt generate "Here is a diff file: {{stream}} Make a concise com
400494
```
401495
> In this illustration, `{{stream}}` denotes the result of the `$ git diff` operation, while `{{copied}}` signifies the content copied from the output of the `$ git log` command.
402496
497+
<details>
498+
499+
<summary>
500+
403501
For more usage info run `$ pytgpt --help`
404502

503+
</summary>
504+
505+
```
506+
Usage: pytgpt [OPTIONS] COMMAND [ARGS]...
507+
508+
Options:
509+
-v, --version Show the version and exit.
510+
-h, --help Show this message and exit.
511+
512+
Commands:
513+
awesome Perform CRUD operations on awesome-prompts
514+
generate Generate a quick response with AI
515+
gpt4free Discover gpt4free models, providers etc
516+
interactive Chat with AI interactively (Default)
517+
utils Utility endpoint for pytgpt
518+
webchatgpt Reverse Engineered ChatGPT Web-Version
519+
```
520+
521+
</details>
405522
## [CHANGELOG](https://github.com/Simatwa/python-tgpt/blob/main/docs/CHANGELOG.md)
406523

407524
## Acknowledgements

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ appdirs==1.4.4
77
webchatgpt==0.2.7
88
GoogleBard==1.4.0
99
colorama==0.4.6
10-
g4f==0.2.0.3
10+
g4f>=0.2.0.3

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
setup(
1616
name="python-tgpt",
17-
version="0.3.1",
17+
version="0.3.2",
1818
license="MIT",
1919
author="Smartwa",
2020
maintainer="Smartwa",
@@ -46,7 +46,7 @@
4646
"webchatgpt==0.2.7",
4747
"GoogleBard==1.4.0",
4848
"colorama==0.4.6",
49-
"g4f==0.2.0.3",
49+
"g4f>=0.2.0.3",
5050
],
5151
python_requires=">=3.9",
5252
keywords=[

src/pytgpt/__init__.py

Lines changed: 14 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,24 @@
11
from .utils import appdir
2+
import g4f
23

3-
__version__ = "0.3.1"
4+
__version__ = "0.3.2"
45
__author__ = "Smartwa"
56
__repo__ = "https://github.com/Simatwa/python-tgpt"
67

8+
tgpt_providers = [
9+
"leo",
10+
"openai",
11+
"fakeopen",
12+
"opengpt",
13+
"koboldai",
14+
"bard",
15+
]
16+
717
gpt4free_providers = [
8-
"AItianhuSpace",
9-
"AiChatOnline",
10-
"Aura",
11-
"Bard",
12-
"Bing",
13-
"ChatBase",
14-
"ChatForAi",
15-
"Chatgpt4Online",
16-
"ChatgptAi",
17-
"ChatgptDemo",
18-
"ChatgptNext",
19-
"Chatxyz",
20-
"DeepInfra",
21-
"FakeGpt",
22-
"FreeChatgpt",
23-
"GPTalk",
24-
"GeekGpt",
25-
"GeminiProChat",
26-
"Gpt6",
27-
"GptChatly",
28-
"GptForLove",
29-
"GptGo",
30-
"GptTalkRu",
31-
"Hashnode",
32-
"HuggingChat",
33-
"Koala",
34-
"Liaobots",
35-
"Llama2",
36-
"MyShell",
37-
"OnlineGpt",
38-
"OpenaiChat",
39-
"PerplexityAi",
40-
"Phind",
41-
"Pi",
42-
"Poe",
43-
"Raycast",
44-
"TalkAi",
45-
"Theb",
46-
"ThebApi",
47-
"You",
48-
"Yqcloud",
18+
provider.__name__ for provider in g4f.Provider.__providers__ # if provider.working
4919
]
50-
available_providers = ["leo", "openai", "fakeopen", "opengpt", "koboldai", "bard"] + gpt4free_providers
20+
21+
available_providers = tgpt_providers + gpt4free_providers
5122

5223
__all__ = [
5324
"appdir",

0 commit comments

Comments
 (0)