Render inline any image files output by code in message

Update regex to also include any links to code generated images that
aren't explicitly meant to be displayed inline. This allows folks to
download the image (unlike the fake link that doesn't work created by
model)
This commit is contained in:
Debanjum Singh Solanky
2024-10-11 01:11:34 -07:00
parent 20d495c43a
commit 9daaae0fdb
3 changed files with 6 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ import { createRoot } from "react-dom/client";
import "katex/dist/katex.min.css";
import { TeaserReferencesSection, constructAllReferences } from "../referencePanel/referencePanel";
import { replaceFileLinksWithBase64 } from "@/app/common/chatFunctions";
import { renderCodeGenImageInline } from "@/app/common/chatFunctions";
import {
ThumbsUp,
@@ -379,7 +379,7 @@ const ChatMessage = forwardRef<HTMLDivElement, ChatMessageProps>((props, ref) =>
}
// Replace file links with base64 data
message = replaceFileLinksWithBase64(message, props.chatMessage.codeContext);
message = renderCodeGenImageInline(message, props.chatMessage.codeContext);
// Add code context files to the message
if (props.chatMessage.codeContext) {