summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorabc <98614666+xtekky@users.noreply.github.com>2023-09-27 20:07:12 +0200
committerabc <98614666+xtekky@users.noreply.github.com>2023-09-27 20:07:12 +0200
commit26e1fc4a7dbe290d670144a39584502251b3727b (patch)
tree939abf8126042e395c1b0a9318af5118c65c6870
parent~ | g4f v-0.1.3.9 (diff)
downloadgpt4free-26e1fc4a7dbe290d670144a39584502251b3727b.tar
gpt4free-26e1fc4a7dbe290d670144a39584502251b3727b.tar.gz
gpt4free-26e1fc4a7dbe290d670144a39584502251b3727b.tar.bz2
gpt4free-26e1fc4a7dbe290d670144a39584502251b3727b.tar.lz
gpt4free-26e1fc4a7dbe290d670144a39584502251b3727b.tar.xz
gpt4free-26e1fc4a7dbe290d670144a39584502251b3727b.tar.zst
gpt4free-26e1fc4a7dbe290d670144a39584502251b3727b.zip
-rw-r--r--README.md2
-rw-r--r--g4f/__init__.py16
-rw-r--r--setup.py2
3 files changed, 17 insertions, 3 deletions
diff --git a/README.md b/README.md
index 8247c2f0..99c501ad 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ By using this repository or any code related to it, you agree to the [legal noti
### New
- official website: *https://g4f.ai*
-- latest pypi version: ([0.1.3.9](https://pypi.org/project/g4f/0.1.3.9)):
+- latest pypi version: ([0.1.4.0](https://pypi.org/project/g4f/0.1.4.0)):
```sh
pip install -U g4f
diff --git a/g4f/__init__.py b/g4f/__init__.py
index 6fe7aa10..5bf96451 100644
--- a/g4f/__init__.py
+++ b/g4f/__init__.py
@@ -2,9 +2,23 @@ from __future__ import annotations
from g4f import models
from .Provider import BaseProvider, AsyncProvider
from .typing import Any, CreateResult, Union
+from requests import get
logging = False
-version = '0.1.3.9'
+version = '0.1.4.0'
+
+def check_pypi_version():
+ try:
+ response = get(f"https://pypi.org/pypi/g4f/json").json()
+ latest_version = response["info"]["version"]
+
+ if version != latest_version:
+ print(f'New pypi version: {latest_version} (current: {version}) | pip install -U g4f')
+
+ except Exception as e:
+ print(f'Failed to check g4f pypi version: {e}')
+
+check_pypi_version()
def get_model_and_provider(model: Union[models.Model, str], provider: type[BaseProvider], stream: bool):
if isinstance(model, str):
diff --git a/setup.py b/setup.py
index 43e9ac03..7512b2ae 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ with open("requirements.txt") as f:
with open("interference/requirements.txt") as f:
api_required = f.read().splitlines()
-VERSION = '0.1.3.9'
+VERSION = '0.1.4.0'
DESCRIPTION = (
"The official gpt4free repository | various collection of powerful language models"
)