mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Unescape special characters in prompt traces for better readability
This commit is contained in:
parent
ea0712424b
commit
8af9dc3ee1
1 changed files with 2 additions and 0 deletions
|
@ -431,6 +431,8 @@ def commit_conversation_trace(
|
||||||
# Write files and stage them
|
# Write files and stage them
|
||||||
for filename, content in files_to_commit.items():
|
for filename, content in files_to_commit.items():
|
||||||
file_path = os.path.join(repo_path, filename)
|
file_path = os.path.join(repo_path, filename)
|
||||||
|
# Unescape special characters in content for better readability
|
||||||
|
content = content.strip().replace("\\n", "\n").replace("\\t", "\t")
|
||||||
with open(file_path, "w", encoding="utf-8") as f:
|
with open(file_path, "w", encoding="utf-8") as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
repo.index.add([filename])
|
repo.index.add([filename])
|
||||||
|
|
Loading…
Reference in a new issue