返回提交历史
Modified
g4f/client/async.py
+1
-15
XFEstudio/gpt4free
Update async.py
8335359c
代码差异
1 个文件
+1
-15
@@ -16,21 +16,7 @@ from . import get_model_and_provider, get_last_provider
16
16
from .Provider.BingCreateImages import BingCreateImages
17
17
from .Provider.needs_auth import Gemini, OpenaiChat
18
18
from .Provider.You import You
19
20
def read_json(text: str) -> dict:
21
"""
22
Parses JSON code block from a string.
23
24
Args:
25
text (str): A string containing a JSON code block.
26
27
Returns:
28
dict: A dictionary parsed from the JSON code block.
29
"""
30
match = re.search(r"```(json|)\n(?P<code>[\S\s]+?)\n```", text)
31
if match:
32
return match.group("code")
33
return text
19
from .helper import read_json
34
20
35
21
def iter_response(
36
22
response: iter[str],