From bab62e43454391f60a2f4a4e5a23d4c494a73019 Mon Sep 17 00:00:00 2001 From: RasyiidWho Date: Mon, 22 Jan 2024 01:33:41 +0700 Subject: Fix Phind context and chat history not keeping up with the prompt --- g4f/Provider/Phind.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'g4f') diff --git a/g4f/Provider/Phind.py b/g4f/Provider/Phind.py index 9e80baa9..b0df3edc 100644 --- a/g4f/Provider/Phind.py +++ b/g4f/Provider/Phind.py @@ -39,10 +39,10 @@ class Phind(AsyncGeneratorProvider): prompt = messages[-1]["content"] data = { "question": prompt, - "questionHistory": [ + "question_history": [ message["content"] for message in messages[:-1] if message["role"] == "user" ], - "answerHistory": [ + "answer_history": [ message["content"] for message in messages if message["role"] == "assistant" ], "webResults": [], @@ -55,7 +55,7 @@ class Phind(AsyncGeneratorProvider): "creativeMode": creative_mode, "customLinks": [] }, - "context": "", + "context": ([message["content"] for message in messages if message["role"] == "system"])[0] if ([message["content"] for message in messages if message["role"] == "system"]) else "", "rewrittenQuestion": prompt, "challenge": 0.21132115912208504 } -- cgit v1.2.3