summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-01-21 19:53:10 +0100
committerGitHub <noreply@github.com>2024-01-21 19:53:10 +0100
commit64052f253b79fd265505e90974fc2378157ec6e3 (patch)
treef0783eceb1b64344dde39c3c21215526ae95ce97 /g4f
parentMerge pull request #1496 from hlohaus/neww (diff)
parentFix Phind context and chat history not keeping up with the prompt (diff)
downloadgpt4free-64052f253b79fd265505e90974fc2378157ec6e3.tar
gpt4free-64052f253b79fd265505e90974fc2378157ec6e3.tar.gz
gpt4free-64052f253b79fd265505e90974fc2378157ec6e3.tar.bz2
gpt4free-64052f253b79fd265505e90974fc2378157ec6e3.tar.lz
gpt4free-64052f253b79fd265505e90974fc2378157ec6e3.tar.xz
gpt4free-64052f253b79fd265505e90974fc2378157ec6e3.tar.zst
gpt4free-64052f253b79fd265505e90974fc2378157ec6e3.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/Phind.py6
1 files changed, 3 insertions, 3 deletions
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
}