From 32252def150da94f12d1f3c07f977af6d8931402 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Sun, 14 Jan 2024 15:04:37 +0100 Subject: Change doctypes style to Google Fix typo in latest_version Fix Phind Provider Add unittest worklow and main tests --- g4f/Provider/Phind.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'g4f/Provider/Phind.py') diff --git a/g4f/Provider/Phind.py b/g4f/Provider/Phind.py index bb216989..9e80baa9 100644 --- a/g4f/Provider/Phind.py +++ b/g4f/Provider/Phind.py @@ -59,12 +59,16 @@ class Phind(AsyncGeneratorProvider): "rewrittenQuestion": prompt, "challenge": 0.21132115912208504 } - async with session.post(f"{cls.url}/api/infer/followup/answer", headers=headers, json=data) as response: + async with session.post(f"https://https.api.phind.com/infer/", headers=headers, json=data) as response: new_line = False async for line in response.iter_lines(): if line.startswith(b"data: "): chunk = line[6:] - if chunk.startswith(b"") or chunk.startswith(b""): + if chunk.startswith(b''): + break + if chunk.startswith(b'') or chunk.startswith(b''): + pass + elif chunk.startswith(b"") or chunk.startswith(b""): pass elif chunk: yield chunk.decode() -- cgit v1.2.3