summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorxtekky <98614666+xtekky@users.noreply.github.com>2023-08-07 13:22:24 +0200
committerGitHub <noreply@github.com>2023-08-07 13:22:24 +0200
commit76f9374ccdb744cd401e14918d9bc2d11ee45cde (patch)
tree30a308262aa1abbec0fe324b953b2c0100d69c97 /g4f
parentMerge pull request #788 from omidima/main-1 (diff)
parentUpdate Ails.py (diff)
downloadgpt4free-76f9374ccdb744cd401e14918d9bc2d11ee45cde.tar
gpt4free-76f9374ccdb744cd401e14918d9bc2d11ee45cde.tar.gz
gpt4free-76f9374ccdb744cd401e14918d9bc2d11ee45cde.tar.bz2
gpt4free-76f9374ccdb744cd401e14918d9bc2d11ee45cde.tar.lz
gpt4free-76f9374ccdb744cd401e14918d9bc2d11ee45cde.tar.xz
gpt4free-76f9374ccdb744cd401e14918d9bc2d11ee45cde.tar.zst
gpt4free-76f9374ccdb744cd401e14918d9bc2d11ee45cde.zip
Diffstat (limited to 'g4f')
-rw-r--r--g4f/Provider/Providers/Ails.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/g4f/Provider/Providers/Ails.py b/g4f/Provider/Providers/Ails.py
index 60d3603e..1433c4a3 100644
--- a/g4f/Provider/Providers/Ails.py
+++ b/g4f/Provider/Providers/Ails.py
@@ -37,7 +37,9 @@ class Utils:
n = e % 10
r = n + 1 if n % 2 == 0 else n
return str(e - n + r)
-
+ def getV():
+ crossref = requests.get("https://ai.ls"+ requests.get("https://ai.ls/?chat=1").text.split('crossorigin href="')[1].split('"')[0]).text.split('G4="')[1].split('"')[0]
+ return crossref
def _create_completion(model: str, messages: list, temperature: float = 0.6, stream: bool = False, **kwargs):
@@ -47,7 +49,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.249',
+ 'client-v': Utils.getV(),
'content-type': 'application/json',
'origin': 'https://ai.ls',
'referer': 'https://ai.ls/',
@@ -90,4 +92,4 @@ def _create_completion(model: str, messages: list, temperature: float = 0.6, str
yield token
params = f'g4f.Providers.{os.path.basename(__file__)[:-3]} supports: ' + \
- '(%s)' % ', '.join([f"{name}: {get_type_hints(_create_completion)[name].__name__}" for name in _create_completion.__code__.co_varnames[:_create_completion.__code__.co_argcount]]) \ No newline at end of file
+ '(%s)' % ', '.join([f"{name}: {get_type_hints(_create_completion)[name].__name__}" for name in _create_completion.__code__.co_varnames[:_create_completion.__code__.co_argcount]])