Skip to content

Commit 973aded

Browse files
committed
Fix system prompt to make openai reasoning models md format response
1 parent 21d1916 commit 973aded

File tree

1 file changed

+2
-1
lines changed
  • src/khoj/processor/conversation/openai

1 file changed

+2
-1
lines changed

src/khoj/processor/conversation/openai/utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,10 @@ def llm_thread(
181181
]
182182
if len(system_messages) > 0:
183183
first_system_message_index, first_system_message = system_messages[0]
184+
first_system_message_content = first_system_message["content"]
184185
formatted_messages[first_system_message_index][
185186
"content"
186-
] = f"{first_system_message} Formatting re-enabled"
187+
] = f"{first_system_message_content}\nFormatting re-enabled"
187188
elif is_twitter_reasoning_model(model_name, api_base_url):
188189
reasoning_effort = "high" if deepthought else "low"
189190
model_kwargs["reasoning_effort"] = reasoning_effort

0 commit comments

Comments
 (0)