Skip to content

Commit

Permalink
Fix Phind context and chat history not keeping up with the prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
RasyiidWho committed Jan 21, 2024
1 parent c809346 commit bab62e4
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 bab62e4

Please sign in to comment.