summaryrefslogtreecommitdiffstats
path: root/gpt4free/README.md
blob: f3ba27ab70b23aa5d7d5df82e48dbbdca4e5b0cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# gpt4free package

### What is it?

gpt4free is a python package that provides some language model api's

### Main Features

- It's free to use
- Easy access

### Installation:

```bash
pip install gpt4free
```

#### Usage:

```python
import gpt4free
from gpt4free import Provider, quora, forefront

# usage You
response = gpt4free.Completion.create(Provider.You, prompt='Write a poem on Lionel Messi')
print(response)

# usage Poe
token = quora.Account.create(logging=False)
response = gpt4free.Completion.create(Provider.Poe, prompt='Write a poem on Lionel Messi', token=token, model='ChatGPT')
print(response)

# usage forefront
token = forefront.Account.create(logging=False)
response = gpt4free.Completion.create(
    Provider.ForeFront, prompt='Write a poem on Lionel Messi', model='gpt-4', token=token
)
print(response)
print(f'END')

# usage theb
response = gpt4free.Completion.create(Provider.Theb, prompt='Write a poem on Lionel Messi')
print(response)

# usage cocalc
response = gpt4free.Completion.create(Provider.CoCalc, prompt='Write a poem on Lionel Messi', cookie_input='')
print(response)

```

### Invocation Arguments

`gpt4free.Completion.create()` method has two required arguments

1. Provider: This is an enum representing different provider
2. prompt: This is the user input

#### Keyword Arguments

Some of the keyword arguments are optional, while others are required.

- You:
    - `safe_search`: boolean - default value is `False`
    - `include_links`: boolean - default value is `False`
    - `detailed`: boolean - default value is `False`
- Quora:
    - `token`: str - this needs to be provided by the user
    - `model`: str - default value is `gpt-4`.
      
  (Available models: `['Sage', 'GPT-4', 'Claude+', 'Claude-instant', 'ChatGPT', 'Dragonfly', 'NeevaAI']`)
- ForeFront:
  - `token`: str - this need to be provided by the user

- Theb:
  (no keyword arguments required)
- CoCalc:
  - `cookie_input`: str - this needs to be provided by user

#### Token generation of quora
```python
from gpt4free import quora

token = quora.Account.create(logging=False)
```

### Token generation of ForeFront
```python
from gpt4free import forefront

token = forefront.Account.create(logging=False)
```

## Copyright:

This program is licensed under the [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.txt)

### Copyright Notice: <a name="copyright"></a>

```
xtekky/gpt4free: multiple reverse engineered language-model api's to decentralise the ai industry.  
Copyright (C) 2023 xtekky

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
```