返回提交历史
Modified
g4f/Provider/Phind.py
+4
-3
XFEstudio/gpt4free
Fix Phind provider
c52ab6dc
代码差异
1 个文件
+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