XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Fix Phind provider

c52ab6dc
Zabir Raihan <zabirraihan6@gmail.com>
提交于

代码差异

1 个文件 +4 -3
Modified g4f/Provider/Phind.py +4 -3
@@ -56,14 +56,15 @@ class Phind(AsyncGeneratorProvider):
56 56 "customLinks": []
57 57 },
58 58 "context": "",
59 "rewrittenQuestion": prompt
59 "rewrittenQuestion": prompt,
60 "challenge": 0.21132115912208504
60 61 }
61 62 async with session.post(f"{cls.url}/api/infer/followup/answer", headers=headers, json=data) as response:
62 63 new_line = False
63 64 async for line in response.iter_lines():
64 65 if line.startswith(b"data: "):
65 66 chunk = line[6:]
66 if chunk.startswith(b"<PHIND_METADATA>"):
67 if chunk.startswith(b"<PHIND_METADATA>") or chunk.startswith(b"<PHIND_INDICATOR>"):
67 68 pass
68 69 elif chunk:
69 70 yield chunk.decode()
@@ -71,4 +72,4 @@ class Phind(AsyncGeneratorProvider):
71 72 yield "\n"
72 73 new_line = False
73 74 else:
74 new_line = True
75 new_line = True