You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
" Hello! It's nice to meet you. Is there something I can help you with or would you like to chat?"
40
40
>>>
41
41
```
42
42
43
-
This project enables seamless interaction with [LLaMA](https://ai.meta.com/llama/) AI without requiring an API Key.
43
+
This project enables seamless interaction with free LLMs without requiring an API Key.
44
44
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 LLaMA's capabilities *(alias **LEO** by Brave)*, 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 as well as OpenAI's ChatGPT models, fostering a smoother AI interaction experience.
46
46
47
47
### Features
48
48
@@ -55,6 +55,17 @@ The name *python-tgpt* draws inspiration from its parent project [tgpt](https://
These are simply the hosts of the LLMs, which include:
63
+
64
+
1. Leo *(By Brave)*
65
+
2. Fakeopen
66
+
3. Koboldai
67
+
4. Opengpt
68
+
5. OpenAI *(API key required)*
58
69
59
70
## Prerequisites
60
71
@@ -94,6 +105,8 @@ Choose one of the following methods to get started.
94
105
95
106
This package offers a convenient command-line interface.
96
107
108
+
> **Note** : `leo` is the default *provider*.
109
+
97
110
- For a quick response:
98
111
```bash
99
112
python -m tgpt generate "<Your prompt>"
@@ -104,6 +117,8 @@ This package offers a convenient command-line interface.
104
117
python -m tgpt interactive "<Kickoff prompt (though not mandatory)>"
105
118
```
106
119
120
+
Make use of flag `--provider` postfixed with the provider name of your choice. e.g `--provider koboldai`
121
+
107
122
You can also simply use `tgpt` instead of `python -m tgpt`.
108
123
109
124
Starting from version 0.1.2, `generate` is the default command if you issue a prompt, and `interactive` takes action if you don't. Therefore, something like this will generate a response and exit `$ tgpt "<Your prompt>"` while `$ tgpt` will fire up an interactive prompt.
@@ -119,8 +134,8 @@ Starting from version 0.1.2, `generate` is the default command if you issue a pr
119
134
1. Generate a quick response
120
135
121
136
```python
122
-
from tgpt importTGPT
123
-
bot =TGPT()
137
+
from tgpt.leoimportLEO
138
+
bot =LEO()
124
139
resp = bot.chat('<Your prompt>')
125
140
print(resp)
126
141
# Output : How may I help you.
@@ -129,8 +144,8 @@ print(resp)
129
144
2. Get back whole response
130
145
131
146
```python
132
-
from tgpt importTGPT
133
-
bot =TGPT()
147
+
from tgpt.leoimportLEO
148
+
bot =LEO()
134
149
resp = bot.ask('<Your Prompt')
135
150
print(resp)
136
151
# Output
@@ -146,8 +161,8 @@ Just add parameter `stream` with value `true`.
146
161
1. Text Generated only
147
162
148
163
```python
149
-
from tgpt importTGPT
150
-
bot =TGPT()
164
+
from tgpt.leoimportLEO
165
+
bot =LEO()
151
166
resp = bot.chat('<Your prompt>', stream=True)
152
167
for value in resp:
153
168
print(value)
@@ -163,8 +178,8 @@ How may I help you today?
163
178
2. Whole Response
164
179
165
180
```python
166
-
from tgpt importTGPT
167
-
bot =TGPT()
181
+
from tgpt.leoimportLEO
182
+
bot =LEO()
168
183
resp = bot.ask('<Your Prompt>', stream=True)
169
184
for value in resp:
170
185
print(value)
@@ -180,6 +195,75 @@ for value in resp:
180
195
"""
181
196
```
182
197
198
+
> **Note** : All providers have got a common class methods.
199
+
200
+
<details>
201
+
202
+
<summary>
203
+
204
+
Openai
205
+
206
+
</summary>
207
+
208
+
```python
209
+
import tgpt.openai as openai
210
+
bot = openai.OPENAI("<OPENAI-API-KEY>")
211
+
print(bot.chat("<Your-prompt>"))
212
+
```
213
+
214
+
</details>
215
+
216
+
217
+
<details>
218
+
219
+
<summary>
220
+
221
+
Koboldai
222
+
223
+
</summary>
224
+
225
+
```python
226
+
import tgpt.koboldai as koboldai
227
+
bot = koboldai.KOBOLDAI()
228
+
print(bot.chat("<Your-prompt>"))
229
+
```
230
+
231
+
</details>
232
+
233
+
234
+
<details>
235
+
236
+
<summary>
237
+
238
+
Fakeopen
239
+
240
+
</summary>
241
+
242
+
```python
243
+
import tgpt.fakeopen as fakeopen
244
+
bot = fakeopen.FAKEOPEN()
245
+
print(bot.chat("<Your-prompt>"))
246
+
```
247
+
248
+
</details>
249
+
250
+
<details>
251
+
252
+
<summary>
253
+
254
+
Opengpt
255
+
256
+
</summary>
257
+
258
+
```python
259
+
import tgpt.opengpt as opengpt
260
+
bot = opengpt.OPENGPT()
261
+
print(bot.chat("<Your-prompt>"))
262
+
```
263
+
264
+
</details>
265
+
266
+
183
267
184
268
</details>
185
269
@@ -192,8 +276,8 @@ To obtain more tailored responses, consider utilizing [optimizers](tgpt/utils.py
192
276
</summary>
193
277
194
278
```python
195
-
from tgpt importTGPT
196
-
bot =TGPT()
279
+
from tgpt.leoimportLEO
280
+
bot =LEO()
197
281
resp = bot.ask('<Your Prompt>', optimizer='code')
198
282
print(resp)
199
283
```
@@ -205,7 +289,7 @@ print(resp)
205
289
You can still disable the mode:
206
290
207
291
```python
208
-
bot =tgpt.TGPT(is_conversation=False)
292
+
bot =koboldai.KOBOLDAI(is_conversation=False)
209
293
```
210
294
211
295
Utilize the `--disable-conversation` flag in the console to achieve the same functionality.
0 commit comments