返回提交历史
Added
gpt4free/README.md
+116
-0
Modified
testing/test_main.py
+1
-2
XFEstudio/gpt4free
added readme for gpt4 module
1981d379
代码差异
2 个文件
+117
-2
@@ -0,0 +1,116 @@
1
# gpt4free package
2
3
### What is it?
4
5
gpt4free is a python package that provides the access to gpt models like ChatGPT and gpt-4 models.
6
7
### Main Features
8
9
- It's free to use
10
- Easy access
11
12
### Installation:
13
14
```bash
15
pip install gpt4free
16
```
17
18
#### Usage:
19
20
```python
21
import gpt4free
22
import gpt4free
23
from gpt4free import Provider, quora, forefront
24
25
# usage You
26
response = gpt4free.Completion.create(Provider.You, prompt='Write a poem on Lionel Messi')
27
print(response)
28
29
# usage Poe
30
token = quora.Account.create(logging=False)
31
response = gpt4free.Completion.create(Provider.Poe, prompt='Write a poem on Lionel Messi', token=token, model='ChatGPT')
32
print(response)
33
34
# usage forefront
35
token = forefront.Account.create(logging=False)
36
response = gpt4free.Completion.create(
37
Provider.ForeFront, prompt='Write a poem on Lionel Messi', model='gpt-4', token=token
38
)
39
print(response)
40
print(f'END')
41
42
# usage theb
43
response = gpt4free.Completion.create(Provider.Theb, prompt='Write a poem on Lionel Messi')
44
print(response)
45
46
# usage cocalc
47
response = gpt4free.Completion.create(Provider.CoCalc, prompt='Write a poem on Lionel Messi', cookie_input='')
48
print(response)
49
50
```
51
52
### Invocation Arguments
53
54
`gpt4free.Completion.create()` method has two required arguments
55
56
1. Provider: This is an enum representing different provider
57
2. prompt: This is the user input
58
59
#### Keyword Arguments
60
61
Some of the keyword arguments are optional, while others are required.
62
63
- You:
64
- `safe_search`: boolean - default value is `False`
65
- `include_links`: boolean - default value is `False`
66
- `detailed`: boolean - default value is `False`
67
- Quora:
68
- `token`: str - this needs to be provided by the user
69
- `model`: str - default value is `gpt-4`.
70
71
(Available models: `['Sage', 'GPT-4', 'Claude+', 'Claude-instant', 'ChatGPT', 'Dragonfly', 'NeevaAI']`)
72
- ForeFront:
73
- `token`: str - this need to be provided by the user
74
75
- Theb:
76
(no keyword arguments required)
77
- CoCalc:
78
- `cookie_input`: str - this needs to be provided by user
79
80
#### Token generation of quora
81
```python
82
from gpt4free import quora
83
84
token = quora.Account.create(logging=False)
85
```
86
87
### Token generation of ForeFront
88
```python
89
from gpt4free import forefront
90
91
token = forefront.Account.create(logging=False)
92
```
93
94
## Copyright:
95
96
This program is licensed under the [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.txt)
97
98
### Copyright Notice: <a name="copyright"></a>
99
100
```
101
xtekky/gpt4free: multiple reverse engineered language-model api's to decentralise the ai industry.
102
Copyright (C) 2023 xtekky
103
104
This program is free software: you can redistribute it and/or modify
105
it under the terms of the GNU General Public License as published by
106
the Free Software Foundation, either version 3 of the License, or
107
(at your option) any later version.
108
109
This program is distributed in the hope that it will be useful,
110
but WITHOUT ANY WARRANTY; without even the implied warranty of
111
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
112
GNU General Public License for more details.
113
114
You should have received a copy of the GNU General Public License
115
along with this program. If not, see <https://www.gnu.org/licenses/>.
116
```
@@ -6,8 +6,7 @@ response = gpt4free.Completion.create(Provider.You, prompt='Write a poem on Lion
6
6
print(response)
7
7
8
8
# usage Poe
9
# token = quora.Account.create(logging=False)
10
token = 'GKzCahZYGKhp76LfE197xw=='
9
token = quora.Account.create(logging=False)
11
10
response = gpt4free.Completion.create(Provider.Poe, prompt='Write a poem on Lionel Messi', token=token, model='ChatGPT')
12
11
print(response)
13
12