From a95403f5947b9ef6207ac2e8cef64bf9a6aaac59 Mon Sep 17 00:00:00 2001
From: Dmitry Afanasyev <71835315+Balshgit@users.noreply.github.com>
Date: Sat, 16 Sep 2023 20:09:40 +0300
Subject: [PATCH] Feat/fix start (#1)
format code
---
Makefile | 2 +-
app/api/system/controllers.py | 5 +-
.../.github/workflows/docker-build-push.yml | 33 +
.../.github/workflows/sync-hugging.yml | 19 +
app/chat-gpt/Caddyfile | 11 +
app/chat-gpt/Dockerfile | 18 +
app/chat-gpt/README.md | 190 ++++
app/chat-gpt/__init__.py | 0
app/chat-gpt/babel.cfg | 2 +
app/chat-gpt/client/css/button.css | 26 +
app/chat-gpt/client/css/buttons.css | 4 +
app/chat-gpt/client/css/checkbox.css | 55 ++
app/chat-gpt/client/css/conversation.css | 158 ++++
app/chat-gpt/client/css/dropdown.css | 10 +
app/chat-gpt/client/css/field.css | 11 +
app/chat-gpt/client/css/global.css | 70 ++
app/chat-gpt/client/css/hljs.css | 68 ++
app/chat-gpt/client/css/label.css | 16 +
app/chat-gpt/client/css/main.css | 14 +
app/chat-gpt/client/css/message-input.css | 27 +
app/chat-gpt/client/css/message.css | 65 ++
app/chat-gpt/client/css/options.css | 10 +
app/chat-gpt/client/css/select.css | 35 +
app/chat-gpt/client/css/settings.css | 44 +
app/chat-gpt/client/css/sidebar.css | 197 ++++
app/chat-gpt/client/css/stop-generating.css | 38 +
app/chat-gpt/client/css/style.css | 18 +
app/chat-gpt/client/css/typing.css | 15 +
app/chat-gpt/client/html/index.html | 135 +++
.../client/img/android-chrome-192x192.png | Bin 0 -> 9473 bytes
.../client/img/android-chrome-512x512.png | Bin 0 -> 35427 bytes
app/chat-gpt/client/img/apple-touch-icon.png | Bin 0 -> 8850 bytes
app/chat-gpt/client/img/favicon-16x16.png | Bin 0 -> 536 bytes
app/chat-gpt/client/img/favicon-32x32.png | Bin 0 -> 1227 bytes
app/chat-gpt/client/img/favicon.ico | Bin 0 -> 9662 bytes
app/chat-gpt/client/img/gpt.png | Bin 0 -> 2040 bytes
app/chat-gpt/client/img/site.webmanifest | 19 +
app/chat-gpt/client/img/user.png | Bin 0 -> 1081 bytes
app/chat-gpt/client/js/change-language.js | 47 +
app/chat-gpt/client/js/chat.js | 508 ++++++++++
app/chat-gpt/client/js/highlight.min.js | 1 +
.../client/js/highlightjs-copy.min.js | 1 +
app/chat-gpt/client/js/icons.js | 1 +
app/chat-gpt/client/js/sidebar-toggler.js | 34 +
app/chat-gpt/client/js/theme-toggler.js | 22 +
app/chat-gpt/config.json | 8 +
app/chat-gpt/docker-compose.yml | 38 +
app/chat-gpt/g4f/Provider/Provider.py | 20 +
.../g4f/Provider/Providers/AiService.py | 42 +
app/chat-gpt/g4f/Provider/Providers/Aichat.py | 47 +
app/chat-gpt/g4f/Provider/Providers/Ails.py | 96 ++
app/chat-gpt/g4f/Provider/Providers/Bard.py | 88 ++
app/chat-gpt/g4f/Provider/Providers/Better.py | 64 ++
app/chat-gpt/g4f/Provider/Providers/Bing.py | 356 +++++++
.../g4f/Provider/Providers/ChatFree.py | 59 ++
.../g4f/Provider/Providers/ChatgptAi.py | 61 ++
.../g4f/Provider/Providers/ChatgptLogin.py | 114 +++
app/chat-gpt/g4f/Provider/Providers/DeepAi.py | 49 +
.../g4f/Provider/Providers/Easychat.py | 67 ++
app/chat-gpt/g4f/Provider/Providers/Ezcht.py | 47 +
.../g4f/Provider/Providers/Fakeopen.py | 59 ++
.../g4f/Provider/Providers/Forefront.py | 42 +
app/chat-gpt/g4f/Provider/Providers/GetGpt.py | 69 ++
.../g4f/Provider/Providers/Gravityengine.py | 33 +
app/chat-gpt/g4f/Provider/Providers/H2o.py | 115 +++
.../g4f/Provider/Providers/Liaobots.py | 61 ++
.../g4f/Provider/Providers/Lockchat.py | 51 +
.../g4f/Provider/Providers/Mishalsgpt.py | 27 +
app/chat-gpt/g4f/Provider/Providers/Phind.py | 38 +
app/chat-gpt/g4f/Provider/Providers/Theb.py | 30 +
app/chat-gpt/g4f/Provider/Providers/Vercel.py | 515 ++++++++++
.../g4f/Provider/Providers/Weuseing.py | 40 +
.../g4f/Provider/Providers/Wewordle.py | 73 ++
app/chat-gpt/g4f/Provider/Providers/Xiaor.py | 47 +
app/chat-gpt/g4f/Provider/Providers/You.py | 20 +
.../g4f/Provider/Providers/Yqcloud.py | 46 +
app/chat-gpt/g4f/Provider/Providers/Zeabur.py | 64 ++
.../g4f/Provider/Providers/__init__.py | 0
.../Provider/Providers/helpers/__init__.py | 0
.../Provider/Providers/helpers/gpt4love.py | 53 ++
.../g4f/Provider/Providers/helpers/phind.py | 81 ++
.../g4f/Provider/Providers/helpers/theb.py | 53 ++
.../g4f/Provider/Providers/helpers/you.py | 82 ++
app/chat-gpt/g4f/Provider/Providers/hteyun.py | 45 +
app/chat-gpt/g4f/Provider/__init__.py | 35 +
app/chat-gpt/g4f/README.md | 5 +
app/chat-gpt/g4f/__init__.py | 57 ++
app/chat-gpt/g4f/active_providers.py | 128 +++
app/chat-gpt/g4f/models.py | 223 +++++
app/chat-gpt/g4f/typing.py | 3 +
app/chat-gpt/g4f/utils.py | 49 +
app/chat-gpt/get_working_providers.py | 7 +
app/chat-gpt/run.py | 47 +
app/chat-gpt/server/__init__.py | 0
app/chat-gpt/server/babel.py | 47 +
app/chat-gpt/server/backend.py | 178 ++++
app/chat-gpt/server/bp.py | 9 +
app/chat-gpt/server/config.py | 23 +
app/chat-gpt/server/website.py | 51 +
app/chat-gpt/translations/README.md | 67 ++
.../ar_SA/LC_MESSAGES/messages.po | 75 ++
.../cs_CZ/LC_MESSAGES/messages.po | 74 ++
.../da_DK/LC_MESSAGES/messages.po | 74 ++
.../de_DE/LC_MESSAGES/messages.po | 74 ++
.../el_GR/LC_MESSAGES/messages.po | 74 ++
.../en_US/LC_MESSAGES/messages.po | 74 ++
.../es_ES/LC_MESSAGES/messages.po | 74 ++
.../es_MX/LC_MESSAGES/messages.po | 74 ++
.../fi_FI/LC_MESSAGES/messages.po | 74 ++
.../fr_FR/LC_MESSAGES/messages.po | 74 ++
.../he_IL/LC_MESSAGES/messages.po | 74 ++
.../hi_IN/LC_MESSAGES/messages.po | 74 ++
.../hu_HU/LC_MESSAGES/messages.po | 74 ++
.../id_ID/LC_MESSAGES/messages.po | 74 ++
.../it_IT/LC_MESSAGES/messages.po | 74 ++
.../ja_JP/LC_MESSAGES/messages.po | 74 ++
.../ko_KR/LC_MESSAGES/messages.po | 74 ++
.../nb_NO/LC_MESSAGES/messages.po | 74 ++
.../nl_NL/LC_MESSAGES/messages.po | 74 ++
.../pl_PL/LC_MESSAGES/messages.po | 75 ++
.../pt_BR/LC_MESSAGES/messages.po | 73 ++
.../ro_RO/LC_MESSAGES/messages.po | 75 ++
.../ru_RU/LC_MESSAGES/messages.po | 75 ++
.../sk_SK/LC_MESSAGES/messages.po | 74 ++
.../sv_SE/LC_MESSAGES/messages.po | 74 ++
.../th_TH/LC_MESSAGES/messages.po | 74 ++
.../tr_TR/LC_MESSAGES/messages.po | 74 ++
.../uk_UA/LC_MESSAGES/messages.po | 75 ++
.../vi_VN/LC_MESSAGES/messages.po | 74 ++
.../zh_Hans_CN/LC_MESSAGES/messages.po | 74 ++
.../zh_Hant_TW/LC_MESSAGES/messages.po | 74 ++
app/constants.py | 2 +-
app/core/bot.py | 15 +-
app/main.py | 28 +-
app/routers.py | 2 +-
deploy/Dockerfile | 4 +-
docker-compose.yml | 19 +-
poetry.lock | 887 ++++++++----------
pyproject.toml | 82 +-
settings/.env.template | 2 +-
settings/config.py | 20 +-
setup.cfg | 54 --
tests/integration/factories/bot.py | 51 +
tests/integration/factories/models.py | 18 +
144 files changed, 8545 insertions(+), 595 deletions(-)
create mode 100644 app/chat-gpt/.github/workflows/docker-build-push.yml
create mode 100644 app/chat-gpt/.github/workflows/sync-hugging.yml
create mode 100644 app/chat-gpt/Caddyfile
create mode 100644 app/chat-gpt/Dockerfile
create mode 100644 app/chat-gpt/README.md
create mode 100644 app/chat-gpt/__init__.py
create mode 100644 app/chat-gpt/babel.cfg
create mode 100644 app/chat-gpt/client/css/button.css
create mode 100644 app/chat-gpt/client/css/buttons.css
create mode 100644 app/chat-gpt/client/css/checkbox.css
create mode 100644 app/chat-gpt/client/css/conversation.css
create mode 100644 app/chat-gpt/client/css/dropdown.css
create mode 100644 app/chat-gpt/client/css/field.css
create mode 100644 app/chat-gpt/client/css/global.css
create mode 100644 app/chat-gpt/client/css/hljs.css
create mode 100644 app/chat-gpt/client/css/label.css
create mode 100644 app/chat-gpt/client/css/main.css
create mode 100644 app/chat-gpt/client/css/message-input.css
create mode 100644 app/chat-gpt/client/css/message.css
create mode 100644 app/chat-gpt/client/css/options.css
create mode 100644 app/chat-gpt/client/css/select.css
create mode 100644 app/chat-gpt/client/css/settings.css
create mode 100644 app/chat-gpt/client/css/sidebar.css
create mode 100644 app/chat-gpt/client/css/stop-generating.css
create mode 100644 app/chat-gpt/client/css/style.css
create mode 100644 app/chat-gpt/client/css/typing.css
create mode 100644 app/chat-gpt/client/html/index.html
create mode 100644 app/chat-gpt/client/img/android-chrome-192x192.png
create mode 100644 app/chat-gpt/client/img/android-chrome-512x512.png
create mode 100644 app/chat-gpt/client/img/apple-touch-icon.png
create mode 100644 app/chat-gpt/client/img/favicon-16x16.png
create mode 100644 app/chat-gpt/client/img/favicon-32x32.png
create mode 100644 app/chat-gpt/client/img/favicon.ico
create mode 100644 app/chat-gpt/client/img/gpt.png
create mode 100644 app/chat-gpt/client/img/site.webmanifest
create mode 100644 app/chat-gpt/client/img/user.png
create mode 100644 app/chat-gpt/client/js/change-language.js
create mode 100644 app/chat-gpt/client/js/chat.js
create mode 100644 app/chat-gpt/client/js/highlight.min.js
create mode 100644 app/chat-gpt/client/js/highlightjs-copy.min.js
create mode 100644 app/chat-gpt/client/js/icons.js
create mode 100644 app/chat-gpt/client/js/sidebar-toggler.js
create mode 100644 app/chat-gpt/client/js/theme-toggler.js
create mode 100644 app/chat-gpt/config.json
create mode 100644 app/chat-gpt/docker-compose.yml
create mode 100644 app/chat-gpt/g4f/Provider/Provider.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/AiService.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Aichat.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Ails.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Bard.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Better.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Bing.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/ChatFree.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/ChatgptAi.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/ChatgptLogin.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/DeepAi.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Easychat.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Ezcht.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Fakeopen.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Forefront.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/GetGpt.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Gravityengine.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/H2o.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Liaobots.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Lockchat.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Mishalsgpt.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Phind.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Theb.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Vercel.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Weuseing.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Wewordle.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Xiaor.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/You.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Yqcloud.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/Zeabur.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/__init__.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/helpers/__init__.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/helpers/gpt4love.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/helpers/phind.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/helpers/theb.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/helpers/you.py
create mode 100644 app/chat-gpt/g4f/Provider/Providers/hteyun.py
create mode 100644 app/chat-gpt/g4f/Provider/__init__.py
create mode 100644 app/chat-gpt/g4f/README.md
create mode 100644 app/chat-gpt/g4f/__init__.py
create mode 100644 app/chat-gpt/g4f/active_providers.py
create mode 100644 app/chat-gpt/g4f/models.py
create mode 100644 app/chat-gpt/g4f/typing.py
create mode 100644 app/chat-gpt/g4f/utils.py
create mode 100644 app/chat-gpt/get_working_providers.py
create mode 100644 app/chat-gpt/run.py
create mode 100644 app/chat-gpt/server/__init__.py
create mode 100644 app/chat-gpt/server/babel.py
create mode 100644 app/chat-gpt/server/backend.py
create mode 100644 app/chat-gpt/server/bp.py
create mode 100644 app/chat-gpt/server/config.py
create mode 100644 app/chat-gpt/server/website.py
create mode 100644 app/chat-gpt/translations/README.md
create mode 100644 app/chat-gpt/translations/ar_SA/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/cs_CZ/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/da_DK/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/de_DE/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/el_GR/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/en_US/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/es_ES/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/es_MX/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/fi_FI/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/fr_FR/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/he_IL/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/hi_IN/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/hu_HU/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/id_ID/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/it_IT/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/ja_JP/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/ko_KR/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/nb_NO/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/nl_NL/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/pl_PL/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/pt_BR/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/ro_RO/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/ru_RU/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/sk_SK/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/sv_SE/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/th_TH/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/tr_TR/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/uk_UA/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/vi_VN/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/zh_Hans_CN/LC_MESSAGES/messages.po
create mode 100644 app/chat-gpt/translations/zh_Hant_TW/LC_MESSAGES/messages.po
delete mode 100644 setup.cfg
create mode 100644 tests/integration/factories/bot.py
create mode 100644 tests/integration/factories/models.py
diff --git a/Makefile b/Makefile
index f3f767d..74922ed 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ PORT=8000
## Запустить приложение
app:
- poetry run uvicorn --host 0.0.0.0 --factory app.main:create_app --port $(PORT) --reload
+ poetry run uvicorn --host 0.0.0.0 --factory app.main:create_app --port $(PORT) --reload --reload-dir=app --reload-dir=settings
## Отформатировать код
format:
diff --git a/app/api/system/controllers.py b/app/api/system/controllers.py
index 676d687..2e705b2 100644
--- a/app/api/system/controllers.py
+++ b/app/api/system/controllers.py
@@ -5,6 +5,7 @@ from starlette import status
from settings.config import get_settings
router = APIRouter()
+settings = get_settings()
@router.get(
@@ -18,13 +19,11 @@ async def healthcheck() -> ORJSONResponse:
@router.post(
- f"/{get_settings().bot_webhook_url}",
+ f"/{settings.bot_webhook_url}",
name="system:process_bot_updates",
status_code=status.HTTP_202_ACCEPTED,
summary="process bot updates",
)
async def process_bot_updates(request: Request) -> ORJSONResponse:
await request.app.state.queue.put_updates_on_queue(request)
- data = await request.app.state.queue.get_updates_from_queue()
- print(data)
return ORJSONResponse(content=None, status_code=status.HTTP_202_ACCEPTED)
diff --git a/app/chat-gpt/.github/workflows/docker-build-push.yml b/app/chat-gpt/.github/workflows/docker-build-push.yml
new file mode 100644
index 0000000..8c62399
--- /dev/null
+++ b/app/chat-gpt/.github/workflows/docker-build-push.yml
@@ -0,0 +1,33 @@
+name: Docker Build and Push
+on:
+ push:
+ branches:
+ - main
+jobs:
+ build-and-push:
+ runs-on: ubuntu-latest
+ steps:
+
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Set up QEMU - Support for more platforms
+ uses: docker/setup-qemu-action@v2
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v2
+
+ - name: Login to Docker Hub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+
+ - name: Build and push Docker image
+ uses: docker/build-push-action@v2
+ with:
+ context: .
+ file: Dockerfile
+ platforms: linux/amd64,linux/arm64
+ push: true
+ tags: ${{ secrets.DOCKER_USERNAME }}/freegpt-webui:latest
diff --git a/app/chat-gpt/.github/workflows/sync-hugging.yml b/app/chat-gpt/.github/workflows/sync-hugging.yml
new file mode 100644
index 0000000..63967cc
--- /dev/null
+++ b/app/chat-gpt/.github/workflows/sync-hugging.yml
@@ -0,0 +1,19 @@
+name: Sync with Hugging Face Hub
+
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Sync with Hugging Face
+ uses: ramonvc/huggingface-sync-action@v0.0.1
+ with:
+ github_repo_id: ramonvc/freegpt-webui
+ huggingface_repo_id: monra/freegpt-webui
+ repo_type: space
+ space_sdk: docker
+ hf_token: ${{ secrets.HF_TOKEN }}
\ No newline at end of file
diff --git a/app/chat-gpt/Caddyfile b/app/chat-gpt/Caddyfile
new file mode 100644
index 0000000..f337821
--- /dev/null
+++ b/app/chat-gpt/Caddyfile
@@ -0,0 +1,11 @@
+:8080 {
+
+ # Serving dynamic requests:
+ reverse_proxy chat_gpt:1338
+
+ # Logs:
+ log {
+ output stdout
+ }
+
+}
diff --git a/app/chat-gpt/Dockerfile b/app/chat-gpt/Dockerfile
new file mode 100644
index 0000000..2b931be
--- /dev/null
+++ b/app/chat-gpt/Dockerfile
@@ -0,0 +1,18 @@
+FROM python:3.11-slim
+
+WORKDIR /app
+
+COPY requirements.txt requirements.txt
+
+RUN python -m venv venv
+ENV PATH="/app/venv/bin:$PATH"
+
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends build-essential libffi-dev cmake libcurl4-openssl-dev \
+ && pip install --upgrade pip && pip3 install --no-cache-dir -r requirements.txt
+
+COPY . .
+
+RUN chmod -R 777 translations
+
+CMD ["python3", "./run.py"]
diff --git a/app/chat-gpt/README.md b/app/chat-gpt/README.md
new file mode 100644
index 0000000..600e25a
--- /dev/null
+++ b/app/chat-gpt/README.md
@@ -0,0 +1,190 @@
+# FreeGPT WebUI
+
+## Build
+```bash
+docker build -t balsh_chat_gpt --network=host .
+```
+
+
+## GPT 3.5/4
+
+NOT REQUIRE ANY API KEY ❌🔑
+
+This project features a WebUI utilizing the [G4F API](https://github.com/xtekky/gpt4free).
+Experience the power of ChatGPT with a user-friendly interface, enhanced jailbreaks, and completely free.
+
+## Known bugs 🚧
+- Stream mode not working properly.
+
+## News 📢
+I have created a new version of FreeGPT WebUI using the [ChimeraGPT API](https://chimeragpt.adventblocks.cc/).
+
+
+This free API allows you to use various AI chat models, including GPT-4, GPT-4-32k, llama-2 and more.
+Check out the project here: [FreeGPT WebUI - Chimera Version](https://github.com/ramonvc/freegpt-webui/tree/chimeragpt-version).
+
+## Project Hosting and Demonstration 🌐🚀
+The project is hosted on multiple platforms to be tested and modified.
+|Platform|Status|API Key|Free|Repo|Demo|
+|--|--|--|--|--|--|
+|[replit](https://replit.com/)||◼️|☑️|[FreeGPT WebUI](https://replit.com/@ramonvc/freegpt-webui)|[Chat](https://freegpt-webui.ramonvc.repl.co/chat/)
+|[hugging face](https://huggingface.co)||◼️|☑️|[FreeGPT WebUI](https://huggingface.co/spaces/monra/freegpt-webui/tree/main)|[Chat](https://huggingface.co/spaces/monra/freegpt-webui)
+|[replit](https://replit.com/)||☑️|☑️|[FreeGPT WebUI - Chimera Version](https://replit.com/@ramonvc/freegpt-webui-chimera)|[Chat](https://freegpt-webui-chimera.ramonvc.repl.co/chat/)
+|[hugging face](https://huggingface.co)||☑️|☑️|[FreeGPT WebUI - Chimera Version](https://huggingface.co/spaces/monra/freegpt-webui-chimera/tree/main)|[Chat](https://huggingface.co/spaces/monra/freegpt-webui-chimera)
+
+## Note ℹ️
+
+ FreeGPT is a project that utilizes various free AI conversation API Providers. Each Provider is an API that provides responses generated by different AI models. The source code related to these services is available in G4F folder. + +It is important to note that, due to the extensive reach of this project, the free services registered here may receive a significant number of requests, which can result in temporary unavailability or access limitations. Therefore, it is common to encounter these services being offline or unstable. + +We recommend that you search for your own Providers and add them to your personal projects to avoid service instability and unavailability. Within the project, in the Providers folder, you will find several examples of Providers that have worked in the past or are still functioning. It is easy to follow the logic of these examples to find free GPT services and incorporate the requests into your specific FreeGPT project. + +Please note that the choice and integration of additional Providers are the user's responsibility and are not directly related to the FreeGPT project, as the project serves as an example of how to combine the G4F API with a web interface. +
+ +## Table of Contents +- [To-Do List](#to-do-list-%EF%B8%8F) +- [Getting Started](#getting-started-white_check_mark) + - [Cloning the Repository](#cloning-the-repository-inbox_tray) + - [Install Dependencies](#install-dependencies-wrench) +- [Running the Application](#running-the-application-rocket) +- [Docker](#docker-) + - [Prerequisites](#prerequisites) + - [Running the Docker](#running-the-docker) +- [Incorporated Projects](#incorporated-projects-busts_in_silhouette) + - [WebUI](#webui) + - [API FreeGPT](#api-g4f) +- [Star History](#star-history) +- [Legal Notice](#legal-notice) + +## + +## To-Do List ✔️ + +- [x] Integrate the free GPT API into the WebUI +- [x] Create Docker support +- [x] Improve the Jailbreak functionality +- [x] Add the GPT-4 model +- [x] Enhance the user interface +- [ ] Check status of API Providers (online/offline) +- [ ] Enable editing and creating Jailbreaks/Roles in the WebUI +- [ ] Refactor web client + +## Getting Started :white_check_mark: +To get started with this project, you'll need to clone the repository and have [Python](https://www.python.org/downloads/) installed on your system. + +### Cloning the Repository :inbox_tray: +Run the following command to clone the repository: + +``` +git clone https://github.com/ramonvc/freegpt-webui.git +``` + +### Install Dependencies :wrench: +Navigate to the project directory: +``` +cd freegpt-webui +``` + +Install the dependencies: +``` +pip install -r requirements.txt +``` +## Running the Application :rocket: +To run the application, run the following command: +``` +python run.py +``` + +Access the application in your browser using the URL: +``` +http://127.0.0.1:1338 +``` +or +``` +http://localhost:1338 +``` + + +## Docker 🐳 +### Prerequisites +Before you start, make sure you have installed [Docker](https://www.docker.com/get-started) on your machine. + +### Running the Docker +Pull the Docker image from Docker Hub: +``` +docker pull ramonvc/freegpt-webui +``` + +Run the application using Docker: +``` +docker run -p 1338:1338 ramonvc/freegpt-webui +``` + +Access the application in your browser using the URL: +``` +http://127.0.0.1:1338 +``` +or +``` +http://localhost:1338 +``` + +When you're done using the application, stop the Docker containers using the following command: +``` +docker stop