Merge pull request #1495 from RasyiidWho/main

Fix Phind context and chat history not keeping up with the prompt
This commit is contained in:
H Lohaus 2024-01-21 19:53:10 +01:00 committed by GitHub
commit 64052f253b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}