From 76c7be3172f880932926a59e704e14a5f1f15067 Mon Sep 17 00:00:00 2001 From: abc <98614666+xtekky@users.noreply.github.com> Date: Sun, 16 Jul 2023 19:27:01 +0100 Subject: minor fixes ails, chatgptai ... --- g4f/Provider/Providers/Ails.py | 2 +- g4f/Provider/Providers/BingHuan.py | 1 - g4f/Provider/Providers/ChatgptAi.py | 3 +-- g4f/Provider/__init__.py | 3 ++- 4 files changed, 4 insertions(+), 5 deletions(-) (limited to 'g4f/Provider') diff --git a/g4f/Provider/Providers/Ails.py b/g4f/Provider/Providers/Ails.py index 1a14b2e9..54d9e066 100644 --- a/g4f/Provider/Providers/Ails.py +++ b/g4f/Provider/Providers/Ails.py @@ -45,7 +45,7 @@ def _create_completion(model: str, messages: list, temperature: float = 0.6, str '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', 'authorization': 'Bearer free', 'client-id': str(uuid.uuid4()), - 'client-v': '0.1.217', + 'client-v': '0.1.249', 'content-type': 'application/json', 'origin': 'https://ai.ls', 'referer': 'https://ai.ls/', diff --git a/g4f/Provider/Providers/BingHuan.py b/g4f/Provider/Providers/BingHuan.py index 7344a342..9703e0f1 100644 --- a/g4f/Provider/Providers/BingHuan.py +++ b/g4f/Provider/Providers/BingHuan.py @@ -19,7 +19,6 @@ def _create_completion(model: str, messages: list, stream: bool, **kwargs): for line in iter(p.stdout.readline, b''): yield line.decode('cp1252') - params = f'g4f.Providers.{os.path.basename(__file__)[:-3]} supports: ' + \ diff --git a/g4f/Provider/Providers/ChatgptAi.py b/g4f/Provider/Providers/ChatgptAi.py index 00d4cf6f..929ec216 100644 --- a/g4f/Provider/Providers/ChatgptAi.py +++ b/g4f/Provider/Providers/ChatgptAi.py @@ -13,8 +13,7 @@ def _create_completion(model: str, messages: list, stream: bool, **kwargs): chat += '%s: %s\n' % (message['role'], message['content']) chat += 'assistant: ' - response = requests.get('https://chatgpt.ai/gpt-4/') - + response = requests.get('https://chatgpt.ai/') nonce, post_id, _, bot_id = re.findall(r'data-nonce="(.*)"\n data-post-id="(.*)"\n data-url="(.*)"\n data-bot-id="(.*)"\n data-width', response.text)[0] headers = { diff --git a/g4f/Provider/__init__.py b/g4f/Provider/__init__.py index e8fbf617..8488cec1 100644 --- a/g4f/Provider/__init__.py +++ b/g4f/Provider/__init__.py @@ -21,7 +21,8 @@ from .Providers import ( DFEHub, AiService, BingHuan, - Wewordle + Wewordle, + ChatgptAi, ) Palm = Bard -- cgit v1.2.3