From 6f4d1ca7bab3cf759ba32594419db2f10d2fddc4 Mon Sep 17 00:00:00 2001 From: abc <98614666+xtekky@users.noreply.github.com> Date: Mon, 17 Jul 2023 01:12:49 +0100 Subject: [PATCH] pypi package (pip install `g4f`) --- .gitignore | 7 +++++-- README.md | 6 ++++++ g4f/.v1/requirements.txt | 8 ++++++-- pyproject.toml | 20 -------------------- requirements.txt | 29 ++++++----------------------- setup.py | 36 ++++++++++++++++++++++++++++++++++++ 6 files changed, 59 insertions(+), 47 deletions(-) delete mode 100644 pyproject.toml create mode 100644 setup.py diff --git a/.gitignore b/.gitignore index 6d48abcb..91cab9f4 100644 --- a/.gitignore +++ b/.gitignore @@ -30,5 +30,8 @@ cookie.json *.pyc dist/ - -setup.py \ No newline at end of file +*.egg-info/ +*.egg +*.egg-info +build +test.py \ No newline at end of file diff --git a/README.md b/README.md index 0aac7d2d..3f84bdad 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,12 @@ By using this repository or any code related to it, you agree to the [legal noti This (quite censored) New Version of gpt4free, was just released, it may contain bugs, open an issue or contribute a PR when encountering one, some features were disabled. Docker is for now not available but I would be happy if someone contributes a PR. The g4f GUI will be uploaded soon enough. +### New +- pypi package: +``` +pip install g4f +``` + ## Table of Contents: - [Getting Started](#getting-started) diff --git a/g4f/.v1/requirements.txt b/g4f/.v1/requirements.txt index 3a1f815b..4cbabf17 100644 --- a/g4f/.v1/requirements.txt +++ b/g4f/.v1/requirements.txt @@ -5,11 +5,13 @@ pypasser names colorama curl_cffi +aiohttp +flask +flask_cors streamlit selenium fake-useragent twocaptcha -https://github.com/AI-Yash/st-chat/archive/refs/pull/24/head.zip pydantic pymailtm Levenshtein @@ -18,4 +20,6 @@ mailgw_temporary_email pycryptodome random-password-generator numpy>=1.22.2 # not directly required, pinned by Snyk to avoid a vulnerability -tornado>=6.3.2 # not directly required, pinned by Snyk to avoid a vulnerability \ No newline at end of file +tornado>=6.3.2 # not directly required, pinned by Snyk to avoid a vulnerability +PyExecJS +browser_cookie3 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 5ca5c4e2..00000000 --- a/pyproject.toml +++ /dev/null @@ -1,20 +0,0 @@ -[build-system] -requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" - -[project] -name = "gpt4free" -version = "0.2.0" -description = "" -authors = [] -license = { text = "GPL-3.0" } -readme = "README.md" -requires-python = ">=3.10" -dynamic = ["dependencies"] - -[tool.setuptools.packages.find] -include = ["g4f*"] - - -[tool.setuptools.dynamic] -dependencies = {file = ["requirements.txt"]} diff --git a/requirements.txt b/requirements.txt index f9757fe0..c0437927 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,26 +1,9 @@ -websocket-client -requests -tls-client -pypasser -names -colorama +pycryptodome curl_cffi aiohttp -flask -flask_cors -streamlit -selenium -fake-useragent -twocaptcha -streamlit-chat@https://github.com/AI-Yash/st-chat/archive/refs/pull/24/head.zip -pydantic -pymailtm -Levenshtein -retrying -mailgw_temporary_email -pycryptodome -random-password-generator -numpy>=1.22.2 # not directly required, pinned by Snyk to avoid a vulnerability -tornado>=6.3.2 # not directly required, pinned by Snyk to avoid a vulnerability -PyExecJS +asyncio +certifi +Providers browser_cookie3 +websockets +execjs \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..cdbc13ea --- /dev/null +++ b/setup.py @@ -0,0 +1,36 @@ +from setuptools import setup, find_packages +import codecs +import os + +here = os.path.abspath(os.path.dirname(__file__)) + +with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh: + long_description = "\n" + fh.read() + +with open('requirements.txt') as f: + required = f.read().splitlines() + +VERSION = '0.0.1' +DESCRIPTION = 'The official gpt4free repository | various collection of powerful language models' + +# Setting up +setup( + name="g4f", + version=VERSION, + author="Tekky", + author_email="", + description=DESCRIPTION, + long_description_content_type="text/markdown", + long_description=long_description, + packages=find_packages(), + install_requires=required, + keywords=['python', 'chatbot', 'reverse-engineering', 'openai', 'chatbots', 'gpt', 'language-model', 'gpt-3', 'gpt3', 'openai-api', 'gpt-4', 'gpt4', 'chatgpt', 'chatgpt-api', 'openai-chatgpt', 'chatgpt-free', 'chatgpt-4', 'chatgpt4','chatgpt4-api', 'free', 'free-gpt', 'gpt4free', 'g4f'], + classifiers=[ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "Operating System :: Unix", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + ] +) \ No newline at end of file