From 6a4463889eab6cfa4d73efd2aff7c2904640444c Mon Sep 17 00:00:00 2001 From: zengrr <47846202+zeng-rr@users.noreply.github.com> Date: Wed, 23 Aug 2023 15:34:38 +0800 Subject: fix Yqcloud's prompter using only the last message --- g4f/Provider/Yqcloud.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'g4f') diff --git a/g4f/Provider/Yqcloud.py b/g4f/Provider/Yqcloud.py index a3147c2d..82ece2d5 100644 --- a/g4f/Provider/Yqcloud.py +++ b/g4f/Provider/Yqcloud.py @@ -35,7 +35,10 @@ def _create_header(): def _create_payload(messages: list[dict[str, str]]): - prompt = messages[-1]["content"] + prompt = "" + for message in messages: + prompt += "%s: %s\n" % (message["role"], message["content"]) + prompt += "assistant:" return { "prompt": prompt, "network": True, -- cgit v1.2.3