mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-26 09:57:24 +03:00
Merge pull request #1969 from hlohaus/leech
Fix You.com model selection
This commit is contained in:
commit
91e7252123
@ -100,8 +100,9 @@ class You(AsyncGeneratorProvider, ProviderModelMixin):
|
|||||||
"selectedChatMode": chat_mode,
|
"selectedChatMode": chat_mode,
|
||||||
}
|
}
|
||||||
if chat_mode == "custom":
|
if chat_mode == "custom":
|
||||||
# print(f"You model: {model}")
|
if debug.logging:
|
||||||
params["selectedAIModel"] = model.replace("-", "_")
|
print(f"You model: {model}")
|
||||||
|
params["selectedAiModel"] = model.replace("-", "_")
|
||||||
|
|
||||||
async with (session.post if chat_mode == "default" else session.get)(
|
async with (session.post if chat_mode == "default" else session.get)(
|
||||||
f"{cls.url}/api/streamingSearch",
|
f"{cls.url}/api/streamingSearch",
|
||||||
@ -117,9 +118,9 @@ class You(AsyncGeneratorProvider, ProviderModelMixin):
|
|||||||
elif line.startswith(b'data: '):
|
elif line.startswith(b'data: '):
|
||||||
if event in ["youChatUpdate", "youChatToken"]:
|
if event in ["youChatUpdate", "youChatToken"]:
|
||||||
data = json.loads(line[6:])
|
data = json.loads(line[6:])
|
||||||
if event == "youChatToken" and event in data:
|
if event == "youChatToken" and event in data and data[event]:
|
||||||
yield data[event]
|
yield data[event]
|
||||||
elif event == "youChatUpdate" and "t" in data and data["t"] is not None:
|
elif event == "youChatUpdate" and "t" in data and data["t"]:
|
||||||
if chat_mode == "create":
|
if chat_mode == "create":
|
||||||
match = re.search(r"!\[(.+?)\]\((.+?)\)", data["t"])
|
match = re.search(r"!\[(.+?)\]\((.+?)\)", data["t"])
|
||||||
if match:
|
if match:
|
||||||
|
Loading…
Reference in New Issue
Block a user