Add uploaded images to research mode, code slash command, include code references

This commit is contained in:
sabaimran
2024-10-23 21:45:17 -07:00
committed by Debanjum Singh Solanky
parent 5acf40c440
commit a11b5293fb
3 changed files with 18 additions and 12 deletions

View File

@@ -301,6 +301,9 @@ export function TrainOfThought(props: TrainOfThoughtProps) {
const iconColor = props.primary ? convertColorToTextClass(props.agentColor) : "text-gray-500";
const icon = chooseIconFromHeader(header, iconColor);
let markdownRendered = DOMPurify.sanitize(md.render(props.message));
// Remove any header tags from markdownRendered
markdownRendered = markdownRendered.replace(/<h[1-6].*?<\/h[1-6]>/g, "");
return (
<div
className={`${styles.trainOfThoughtElement} break-all items-center ${props.primary ? "text-gray-400" : "text-gray-300"} ${styles.trainOfThought} ${props.primary ? styles.primary : ""}`}