summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaju Komati <komatiraju032@gmail.com>2023-04-29 12:13:24 +0200
committerRaju Komati <komatiraju032@gmail.com>2023-04-29 12:13:24 +0200
commit1981d379d5b79d858f1c0faa8e4c95bcb4e98236 (patch)
treeeee172bf301df2e5b2c55d54ec696d455e672fd8
parentrefactored the code (diff)
downloadgpt4free-1981d379d5b79d858f1c0faa8e4c95bcb4e98236.tar
gpt4free-1981d379d5b79d858f1c0faa8e4c95bcb4e98236.tar.gz
gpt4free-1981d379d5b79d858f1c0faa8e4c95bcb4e98236.tar.bz2
gpt4free-1981d379d5b79d858f1c0faa8e4c95bcb4e98236.tar.lz
gpt4free-1981d379d5b79d858f1c0faa8e4c95bcb4e98236.tar.xz
gpt4free-1981d379d5b79d858f1c0faa8e4c95bcb4e98236.tar.zst
gpt4free-1981d379d5b79d858f1c0faa8e4c95bcb4e98236.zip
-rw-r--r--gpt4free/README.md116
-rw-r--r--testing/test_main.py3
2 files changed, 117 insertions, 2 deletions
diff --git a/gpt4free/README.md b/gpt4free/README.md
new file mode 100644
index 00000000..944e24a3
--- /dev/null
+++ b/gpt4free/README.md
@@ -0,0 +1,116 @@
+# gpt4free package
+
+### What is it?
+
+gpt4free is a python package that provides the access to gpt models like ChatGPT and gpt-4 models.
+
+### Main Features
+
+- It's free to use
+- Easy access
+
+### Installation:
+
+```bash
+pip install gpt4free
+```
+
+#### Usage:
+
+```python
+import gpt4free
+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/>.
+``` \ No newline at end of file
diff --git a/testing/test_main.py b/testing/test_main.py
index bd4d03e9..7c28f1d2 100644
--- a/testing/test_main.py
+++ b/testing/test_main.py
@@ -6,8 +6,7 @@ response = gpt4free.Completion.create(Provider.You, prompt='Write a poem on Lion
print(response)
# usage Poe
-# token = quora.Account.create(logging=False)
-token = 'GKzCahZYGKhp76LfE197xw=='
+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)