mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 16:14:21 +00:00
Fix, improve displaying chat messages, sources by Khoj in web interface
Pretty pretty json in conversation logs
This commit is contained in:
parent
6c0e82b2d6
commit
8609e3129e
2 changed files with 4 additions and 2 deletions
src/khoj
|
@ -219,7 +219,7 @@ def save_chat_session():
|
|||
conversation_logfile = resolve_absolute_path(state.processor_config.conversation.conversation_logfile)
|
||||
conversation_logfile.parent.mkdir(parents=True, exist_ok=True) # create conversation directory if doesn't exist
|
||||
with open(conversation_logfile, "w+", encoding="utf-8") as logfile:
|
||||
json.dump(conversation_log, logfile)
|
||||
json.dump(conversation_log, logfile, indent=2)
|
||||
|
||||
state.processor_config.conversation.chat_session = None
|
||||
logger.info("📩 Saved current chat session to conversation logs")
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
|
||||
function generateReference(reference, index) {
|
||||
// Generate HTML for Chat Reference
|
||||
return `<sup><abbr title="${reference}" tabindex="0">${index}</abbr></sup>`;
|
||||
let escaped_ref = reference.replaceAll("\"", "\\\"")
|
||||
return `<sup><abbr title="${escaped_ref}" tabindex="0">${index}</abbr></sup>`;
|
||||
}
|
||||
|
||||
function renderMessage(message, by, dt=null) {
|
||||
|
@ -179,6 +180,7 @@
|
|||
color: #f8fafc;
|
||||
background: #017eff;
|
||||
margin-left: auto;
|
||||
white-space: pre-line;
|
||||
}
|
||||
/* add left protrusion to khoj chat bubble */
|
||||
.chat-message-text.khoj:after {
|
||||
|
|
Loading…
Add table
Reference in a new issue