diff options
-rw-r--r-- | Docker/Dockerfile | 3 | ||||
-rw-r--r-- | README.md | 45 | ||||
-rw-r--r-- | phind/__init__.py | 11 | ||||
-rw-r--r-- | you/__init__.py | 5 |
4 files changed, 35 insertions, 29 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 @@ -6,7 +6,7 @@ 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 `5.3k` stars and all the support!! +By the way, thank you so much for `6k` stars and all the support!! ## Announcement Dear Gpt4free Community, @@ -40,24 +40,24 @@ Please note the following: ## Table of Contents - -- [To do list](#todo) -- [Current Sites](#current-sites) -- [Best Sites for gpt4](#best-sites) -- [How to install](#install) -- [Legal Notice](#legal-notice) -- [Copyright](#copyright) - - -- [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) +| 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> @@ -102,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 . @@ -146,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/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 + } |