Skip to content

Commit

Permalink
bug fix: double quotation marks in format string
Browse files Browse the repository at this point in the history
  • Loading branch information
Maplemx committed Mar 26, 2024
1 parent 8ad370c commit fcdcdf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/plugins/request/ERNIE.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def generate_request_data(self):
system_prompt = ""
for message in messages:
if message["role"] == "system":
system_prompt += f"{ message["content"] }\n"
system_prompt += f"{ message['content'] }\n"
else:
request_messages.append(message)
request_data = {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/request/OAIClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def format_request_messages(self, request_messages):
if message["role"] == "system":
# no_multi_system_messages=True
if self.message_rules["no_multi_system_messages"]:
system_prompt += f"{ message["content"] }\n"
system_prompt += f"{ message['content'] }\n"
# no_multi_system_messages=False
else:
system_messages.append(message)
Expand Down Expand Up @@ -151,7 +151,7 @@ def construct_completion_prompt(self):
if chat_history_data:
prompt_dict["[HISTORY LOGS]"] = ""
for message in chat_history_data:
prompt_dict["[HISTORY LOGS]"] += f"{ message["role"] }: { message["content"] }\n"
prompt_dict["[HISTORY LOGS]"] += f"{ message['role'] }: { message['content'] }\n"
if prompt_input_data:
prompt_dict["[INPUT]"] = to_instruction(prompt_input_data)
if prompt_information_data:
Expand Down

0 comments on commit fcdcdf0

Please sign in to comment.