Skip to content

Commit

Permalink
Merge pull request #1495 from RasyiidWho/main
Browse files Browse the repository at this point in the history
Fix Phind context and chat history not keeping up with the prompt
  • Loading branch information
hlohaus authored Jan 21, 2024
2 parents d01f3f6 + bab62e4 commit 64052f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions g4f/Provider/Phind.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ async def create_async_generator(
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": [],
Expand All @@ -55,7 +55,7 @@ async def create_async_generator(
"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
}
Expand Down

0 comments on commit 64052f2

Please sign in to comment.