Render code output files with code references in reference section

- Improve rendering code reference with better icons, smaller text and
  different line clamps for better visibility
- Show code output files as sub card of code card in reference section
- Allow downloading files generated by code instead of rendering it in
  chat message directly
- Show executed code before online references in reference panel
This commit is contained in:
Debanjum
2024-11-11 00:22:23 -08:00
parent 92c1efe6ee
commit 8e9f4262a9
3 changed files with 118 additions and 27 deletions

View File

@@ -433,14 +433,6 @@ const ChatMessage = forwardRef<HTMLDivElement, ChatMessageProps>((props, ref) =>
if (!message.includes(`![${file.filename}](`)) {
message += `\n\n![${file.filename}](data:image/png;base64,${file.b64_data})`;
}
} else if (
file.filename.endsWith(".txt") ||
file.filename.endsWith(".org") ||
file.filename.endsWith(".md") ||
file.filename.endsWith(".csv") ||
file.filename.endsWith(".json")
) {
message += `\n\n## ${file.filename}\n\`\`\`\n${file.b64_data}\n\`\`\`\n`;
}
});
});