summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Docker/Dockerfile3
-rw-r--r--README.md84
-rw-r--r--phind/__init__.py11
-rw-r--r--testing/phind_test.py2
-rw-r--r--testing/you_test.py (renamed from you_test.py)0
-rw-r--r--unfinished/easyai/main.py32
-rw-r--r--unfinished/vercelai/v2.py29
-rw-r--r--v2.py0
-rw-r--r--you/__init__.py5
9 files changed, 126 insertions, 40 deletions
diff --git a/Docker/Dockerfile b/Docker/Dockerfile
index 89ca0e5d..a7bb7d0a 100644
--- a/Docker/Dockerfile
+++ b/Docker/Dockerfile
@@ -1,10 +1,11 @@
-FROM python:3.10
+FROM python:3.10-slim
RUN apt-get update && apt-get install -y git
RUN git clone https://github.com/xtekky/gpt4free.git
WORKDIR /gpt4free
RUN pip install --no-cache-dir -r requirements.txt
+RUN cp gui/streamlit_app.py .
EXPOSE 8501
diff --git a/README.md b/README.md
index d546c68a..08db179c 100644
--- a/README.md
+++ b/README.md
@@ -6,28 +6,58 @@ Have you ever come across some amazing projects that you couldn't use **just bec
**We've got you covered!** This repository offers **reverse-engineered** third-party APIs for `GPT-4/3.5`, sourced from various websites. You can simply **download** this repository, and use the available modules, which are designed to be used **just like OpenAI's official package**. **Unleash ChatGPT's potential for your projects, now!** You are welcome ; ).
-By the way, thank you so much for `5k` stars and all the support!!
+By the way, thank you so much for [![Stars](https://img.shields.io/github/stars/xtekky/gpt4free?style=social)](https://github.com/xtekky/gpt4free/stargazers) and all the support!!
+## Announcement
+Dear Gpt4free Community,
-## Table of Contents
+I want to thank you for your interest in and support of this project, which I only intended to be for entertainment and educational purposes; I had no idea it would end up being so popular.
+
+I'm aware of the concerns about the project's legality and its impact on smaller sites hosting APIs. I take these concerns seriously and plan to address them.
+
+Here's what I'm doing to fix these issues:
+
+1. Removing APIs from smaller sites: To reduce the impact on smaller sites, I have removed their APIs from the repository. Please shoot me a dm if you are an owner of a site and want it removed.
+
+2. Commitment to ethical use: I want to emphasize my commitment to promoting ethical use of language models. I don't support any illegal or unethical behavior, and I expect users to follow the same principles.
+
+Thank you for your support and understanding. I appreciate your continued interest in gpt4free and am committed to addressing your concerns.
+
+Sincerely,
+xtekky
+
+## Legal Notice <a name="legal-notice"></a>
+
+This repository uses third-party APIs and AI models and is *not* associated with or endorsed by the API providers or the original developers of the models. This project is intended **for educational purposes only**.
+
+Please note the following:
+
+1. **Disclaimer**: The APIs, services, and trademarks mentioned in this repository belong to their respective owners. This project is *not* claiming any right over them.
+
+2. **Responsibility**: The author of this repository is *not* responsible for any consequences arising from the use or misuse of this repository or the content provided by the third-party APIs and any damage or losses caused by users' actions.
-- [To do list](#todo)
-- [Current Sites](#current-sites)
-- [Best Sites for gpt4](#best-sites)
-- [How to install](#install)
-- [Legal Notice](#legal-notice)
-- [Copyright](#copyright)
+3. **Educational Purposes Only**: This repository and its content are provided strictly for educational purposes. By using the information and code provided, users acknowledge that they are using the APIs and models at their own risk and agree to comply with any applicable laws and regulations.
-- [Usage Examples](./README.md)
- - [`quora (poe)`](./quora/README.md)
- - [`phind`](./phind/README.md)
- - [`t3nsor`](./t3nsor/README.md)
- - [`writesonic`](./writesonic/README.md)
- - [`you`](./you/README.md)
- - [`sqlchat`](./sqlchat/README.md)
-
-- [replit Example (feel free to fork this repl)](#replit)
+## Table of Contents
+| Section | Description | Link | Status |
+| ------- | ----------- | ---- | ------ |
+| **To do list** | List of tasks to be done | [![Link to Section](https://img.shields.io/badge/Link-Go%20to%20Section-blue)](#todo) | - |
+| **Current Sites** | Current websites or platforms that can be used as APIs | [![Link to Section](https://img.shields.io/badge/Link-Go%20to%20Section-blue)](#current-sites) | - |
+| **Best Sites for gpt4** | Recommended websites or platforms for gpt4 | [![Link to Section](https://img.shields.io/badge/Link-Go%20to%20Section-blue)](#best-sites) | - |
+| **Streamlit GPT4Free GUI** | Web-based graphical user interface for interacting with gpt4free | [![Link to Section](https://img.shields.io/badge/Link-Go%20to%20Section-blue)](#streamlit-gpt4free-gui) | - |
+| **Docker** | Instructions on how to run gpt4free in a Docker container | [![Link to Section](https://img.shields.io/badge/Link-Go%20to%20Section-blue)](#docker-instructions) | - |
+| **ChatGPT clone** | A ChatGPT clone with new features and scalability | [![Link to Website](https://img.shields.io/badge/Link-Visit%20Site-blue)](https://chat.chatbot.sex/chat) | - |
+| **How to install** | Instructions on how to install gpt4free | [![Link to Section](https://img.shields.io/badge/Link-Go%20to%20Section-blue)](#install) | - |
+| **Legal Notice** | Legal notice or disclaimer | [![Link to Section](https://img.shields.io/badge/Link-Go%20to%20Section-blue)](#legal-notice) | - |
+| **Copyright** | Copyright information | [![Link to Section](https://img.shields.io/badge/Link-Go%20to%20Section-blue)](#copyright) | - |
+| **Usage Examples** | | | |
+| `quora (poe)` | Example usage for quora | [![Link to File](https://img.shields.io/badge/Link-Go%20to%20File-blue)](./quora/README.md) | ![Active](https://img.shields.io/badge/Active-brightgreen) |
+| `phind` | Example usage for phind | [![Link to File](https://img.shields.io/badge/Link-Go%20to%20File-blue)](./phind/README.md) | ![Inactive](https://img.shields.io/badge/Active-brightgreen) |
+| `you` | Example usage for you | [![Link to File](https://img.shields.io/badge/Link-Go%20to%20File-blue)](./you/README.md) | ![Active](https://img.shields.io/badge/Active-brightgreen)
+| **Try it Out** | | | |
+| Google Colab Jupyter Notebook | Example usage for gpt4free | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/DanielShemesh/gpt4free-colab/blob/main/gpt4free.ipynb) | - |
+| replit Example (feel free to fork this repl) | Example usage for gpt4free | [![](https://img.shields.io/badge/Open%20in-Replit-1A1E27?logo=replit)](https://replit.com/@gpt4free/gpt4free-webui) | - |
## Todo <a name="todo"></a>
@@ -52,6 +82,7 @@ By the way, thank you so much for `5k` stars and all the support!!
| [chat.openai.com/chat](https://chat.openai.com/chat) | GPT-3.5 |
| [bard.google.com](https://bard.google.com) | custom / search |
| [bing.com/chat](https://bing.com/chat) | GPT-4/3.5 |
+| [chat.forefront.ai/](https://chat.forefront.ai/) | GPT-4/3.5 |
## Best sites <a name="best-sites"></a>
@@ -71,12 +102,12 @@ install requirements with:
pip3 install -r requirements.txt
```
-## To start gpt4free GUI
+## To start gpt4free GUI <a name="streamlit-gpt4free-gui"></a>
move `streamlit_app.py` from `./gui` to the base folder
then run:
`streamlit run streamlit_app.py` or `python3 -m streamlit run streamlit_app.py`
-## Docker
+## Docker <a name="docker-instructions"></a>
Build
```
docker build -t gpt4free:latest -f Docker/Dockerfile .
@@ -92,18 +123,6 @@ docker run -p 8501:8501 gpt4free:latest
> This site was developed by me and includes **gpt-4/3.5**, **internet access** and **gpt-jailbreak's** like DAN
> run locally here: https://github.com/xtekky/chatgpt-clone
-## Legal Notice <a name="legal-notice"></a>
-
-This repository uses third-party APIs and AI models and is *not* associated with or endorsed by the API providers or the original developers of the models. This project is intended **for educational purposes only**.
-
-Please note the following:
-
-1. **Disclaimer**: The APIs, services, and trademarks mentioned in this repository belong to their respective owners. This project is *not* claiming any right over them.
-
-2. **Responsibility**: The author of this repository is *not* responsible for any consequences arising from the use or misuse of this repository or the content provided by the third-party APIs and any damage or losses caused by users' actions.
-
-3. **Educational Purposes Only**: This repository and its content are provided strictly for educational purposes. By using the information and code provided, users acknowledge that they are using the APIs and models at their own risk and agree to comply with any applicable laws and regulations.
-
## Copyright:
This program is licensed under the [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -127,6 +146,3 @@ 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/>.
```
-
-## replit
-You can fork this repl to host your own ChatGPT-clone WebUI. https://replit.com/@gpt4free/gpt4free-webui
diff --git a/phind/__init__.py b/phind/__init__.py
index 9b1650e0..9f000c6f 100644
--- a/phind/__init__.py
+++ b/phind/__init__.py
@@ -55,6 +55,8 @@ class Search:
def create(prompt: str, actualSearch: bool = True, language: str = 'en') -> dict: # None = no search
if user_agent == '':
raise ValueError('user_agent must be set, refer to documentation')
+ if cf_clearance == '' :
+ raise ValueError('cf_clearance must be set, refer to documentation')
if not actualSearch:
return {
@@ -106,8 +108,11 @@ class Completion:
codeContext: str = '',
language: str = 'en') -> PhindResponse:
- if user_agent == '':
+ if user_agent == '' :
raise ValueError('user_agent must be set, refer to documentation')
+
+ if cf_clearance == '' :
+ raise ValueError('cf_clearance must be set, refer to documentation')
if results is None:
results = Search.create(prompt, actualSearch = True)
@@ -235,6 +240,8 @@ class StreamingCompletion:
if user_agent == '':
raise ValueError('user_agent must be set, refer to documentation')
+ if cf_clearance == '' :
+ raise ValueError('cf_clearance must be set, refer to documentation')
if results is None:
results = Search.create(prompt, actualSearch = True)
@@ -281,4 +288,4 @@ class StreamingCompletion:
@staticmethod
def handle_stream_response(response):
- StreamingCompletion.message_queue.put(response) \ No newline at end of file
+ StreamingCompletion.message_queue.put(response)
diff --git a/testing/phind_test.py b/testing/phind_test.py
index d72db090..2f2560a1 100644
--- a/testing/phind_test.py
+++ b/testing/phind_test.py
@@ -1,7 +1,7 @@
import phind
# set cf_clearance cookie ( not needed at the moment)
-phind.cf_clearance = ''
+phind.cf_clearance = 'MDzwnr3ZWk_ap8u.iwwMR5F3WccfOkhUy_zGNDpcF3s-1682497341-0-160'
phind.user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'
prompt = 'hello world'
diff --git a/you_test.py b/testing/you_test.py
index 9c69cf34..9c69cf34 100644
--- a/you_test.py
+++ b/testing/you_test.py
diff --git a/unfinished/easyai/main.py b/unfinished/easyai/main.py
new file mode 100644
index 00000000..3b246977
--- /dev/null
+++ b/unfinished/easyai/main.py
@@ -0,0 +1,32 @@
+from requests import get
+from os import urandom
+from json import loads
+
+sessionId = urandom(10).hex()
+
+headers = {
+ 'Accept': 'text/event-stream',
+ 'Accept-Language': 'en,fr-FR;q=0.9,fr;q=0.8,es-ES;q=0.7,es;q=0.6,en-US;q=0.5,am;q=0.4,de;q=0.3',
+ 'Cache-Control': 'no-cache',
+ 'Connection': 'keep-alive',
+ 'Pragma': 'no-cache',
+ 'Referer': 'http://easy-ai.ink/chat',
+ 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36',
+ 'token': 'null',
+}
+
+while True:
+ prompt = input('you: ')
+
+ params = {
+ 'message': prompt,
+ 'sessionId': sessionId
+ }
+
+ for chunk in get('http://easy-ai.ink/easyapi/v1/chat/completions', params = params,
+ headers = headers, verify = False, stream = True).iter_lines():
+
+ if b'content' in chunk:
+ data = loads(chunk.decode('utf-8').split('data:')[1])
+ print(data['content'], end='')
+ \ No newline at end of file
diff --git a/unfinished/vercelai/v2.py b/unfinished/vercelai/v2.py
new file mode 100644
index 00000000..d1a4ad05
--- /dev/null
+++ b/unfinished/vercelai/v2.py
@@ -0,0 +1,29 @@
+import requests
+
+
+token = requests.get('https://play.vercel.ai/openai.jpeg', headers={
+ 'authority': 'play.vercel.ai',
+ 'accept-language': 'en,fr-FR;q=0.9,fr;q=0.8,es-ES;q=0.7,es;q=0.6,en-US;q=0.5,am;q=0.4,de;q=0.3',
+ 'referer': 'https://play.vercel.ai/',
+ 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'}).text + '.'
+
+headers = {
+ 'authority': 'play.vercel.ai',
+ 'custom-encoding': token,
+ 'origin': 'https://play.vercel.ai',
+ 'referer': 'https://play.vercel.ai/',
+ 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'
+}
+
+for chunk in requests.post('https://play.vercel.ai/api/generate', headers=headers, stream = True, json = {
+ 'prompt': 'hi',
+ 'model': 'openai:gpt-3.5-turbo',
+ 'temperature': 0.7,
+ 'maxTokens': 200,
+ 'topK': 1,
+ 'topP': 1,
+ 'frequencyPenalty': 1,
+ 'presencePenalty': 1,
+ 'stopSequences': []}).iter_lines():
+
+ print(chunk) \ No newline at end of file
diff --git a/v2.py b/v2.py
deleted file mode 100644
index e69de29b..00000000
--- a/v2.py
+++ /dev/null
diff --git a/you/__init__.py b/you/__init__.py
index 726773ef..073daee9 100644
--- a/you/__init__.py
+++ b/you/__init__.py
@@ -64,7 +64,8 @@ class Completion:
text = response.text.split('}]}\n\nevent: youChatToken\ndata: {"youChatToken": "')[-1]
text = text.replace('"}\n\nevent: youChatToken\ndata: {"youChatToken": "', '')
text = text.replace('event: done\ndata: I\'m Mr. Meeseeks. Look at me.\n\n', '')
-
+ text = text[:-4] # trims '"}', along with the last two remaining newlines
+
extra = {
'youChatSerpResults' : loads(youChatSerpResults),
#'slots' : loads(slots)
@@ -74,4 +75,4 @@ class Completion:
'response': text,
'links' : loads(thirdPartySearchResults)['search']["third_party_search_results"] if includelinks else None,
'extra' : extra if detailed else None,
- } \ No newline at end of file
+ }