From c52ab6dce423a836e84d3b899eb408d1661193f0 Mon Sep 17 00:00:00 2001 From: Zabir Raihan Date: Tue, 26 Dec 2023 21:41:19 +0000 Subject: Fix Phind provider --- g4f/Provider/Phind.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/g4f/Provider/Phind.py b/g4f/Provider/Phind.py index 9d2acc75..bb216989 100644 --- a/g4f/Provider/Phind.py +++ b/g4f/Provider/Phind.py @@ -56,14 +56,15 @@ class Phind(AsyncGeneratorProvider): "customLinks": [] }, "context": "", - "rewrittenQuestion": prompt + "rewrittenQuestion": prompt, + "challenge": 0.21132115912208504 } async with session.post(f"{cls.url}/api/infer/followup/answer", 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""): + if chunk.startswith(b"") or chunk.startswith(b""): pass elif chunk: yield chunk.decode() @@ -71,4 +72,4 @@ class Phind(AsyncGeneratorProvider): yield "\n" new_line = False else: - new_line = True \ No newline at end of file + new_line = True -- cgit v1.2.3