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

XFEstudio/gpt4free

Fix You.com model selection

53968878
Heiner Lohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +6 -5
Modified g4f/Provider/You.py +6 -5
@@ -100,9 +100,10 @@ class You(AsyncGeneratorProvider, ProviderModelMixin):
100 100 "selectedChatMode": chat_mode,
101 101 }
102 102 if chat_mode == "custom":
103 # print(f"You model: {model}")
104 params["selectedAIModel"] = model.replace("-", "_")
105
103 if debug.logging:
104 print(f"You model: {model}")
105 params["selectedAiModel"] = model.replace("-", "_")
106
106 107 async with (session.post if chat_mode == "default" else session.get)(
107 108 f"{cls.url}/api/streamingSearch",
108 109 data=data,
@@ -117,9 +118,9 @@ class You(AsyncGeneratorProvider, ProviderModelMixin):
117 118 elif line.startswith(b'data: '):
118 119 if event in ["youChatUpdate", "youChatToken"]:
119 120 data = json.loads(line[6:])
120 if event == "youChatToken" and event in data:
121 if event == "youChatToken" and event in data and data[event]:
121 122 yield data[event]
122 elif event == "youChatUpdate" and "t" in data and data["t"] is not None:
123 elif event == "youChatUpdate" and "t" in data and data["t"]:
123 124 if chat_mode == "create":
124 125 match = re.search(r"!\[(.+?)\]\((.+?)\)", data["t"])
125 126 if match: