mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 05:29:12 +00:00
Fix storing code results on server and rendering them on web app
- Fix code context data type for validation on server. This would prevent the chat message from being written to history - Handle null code results on web app
This commit is contained in:
@@ -205,7 +205,7 @@ export function renderCodeGenImageInline(message: string, codeContext: CodeConte
|
||||
if (!codeContext) return message;
|
||||
|
||||
Object.values(codeContext).forEach((contextData) => {
|
||||
contextData.results.output_files?.forEach((file) => {
|
||||
contextData.results?.output_files?.forEach((file) => {
|
||||
const regex = new RegExp(`!?\\[.*?\\]\\(.*${file.filename}\\)`, "g");
|
||||
if (file.filename.match(/\.(png|jpg|jpeg)$/i)) {
|
||||
const replacement = `.pop()};base64,${file.b64_data})`;
|
||||
|
||||
Reference in New Issue
Block a user