mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-19 03:25:32 +00:00
Merge pull request #1495 from RasyiidWho/main
Fix Phind context and chat history not keeping up with the prompt
This commit is contained in:
commit
64052f253b
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user