diff --git a/src/components/robot/pages/RobotCreate.tsx b/src/components/robot/pages/RobotCreate.tsx index 312d7bae..65423a99 100644 --- a/src/components/robot/pages/RobotCreate.tsx +++ b/src/components/robot/pages/RobotCreate.tsx @@ -375,7 +375,7 @@ const RobotCreate: React.FC = () => { /> - Turn websites into LLM-ready Markdown or clean HTML content for AI apps. + Turn websites into LLM-ready Markdown & clean HTML for AI apps. diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 3a676a00..f01494c3 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -38,6 +38,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe const { t } = useTranslation(); const [tab, setTab] = React.useState('output'); const [markdownContent, setMarkdownContent] = useState(''); + const [htmlContent, setHtmlContent] = useState(''); const [schemaData, setSchemaData] = useState([]); const [schemaColumns, setSchemaColumns] = useState([]); @@ -65,14 +66,25 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe }, [interpretationInProgress]); useEffect(() => { + setMarkdownContent(''); + setHtmlContent(''); + if (row.serializableOutput?.markdown && Array.isArray(row.serializableOutput.markdown)) { const markdownData = row.serializableOutput.markdown[0]; - if (markdownData && markdownData.content) { + if (markdownData?.content) { setMarkdownContent(markdownData.content); } } + + if (row.serializableOutput?.html && Array.isArray(row.serializableOutput.html)) { + const htmlData = row.serializableOutput.html[0]; + if (htmlData?.content) { + setHtmlContent(htmlData.content); + } + } }, [row.serializableOutput]); + useEffect(() => { if (row.status === 'running' || row.status === 'queued' || row.status === 'scheduled') { setSchemaData([]); @@ -663,68 +675,75 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe const hasData = schemaData.length > 0 || listData.length > 0 || legacyData.length > 0; const hasScreenshots = row.binaryOutput && Object.keys(row.binaryOutput).length > 0; const hasMarkdown = markdownContent.length > 0; + const hasHTML = htmlContent.length > 0; return ( - {hasMarkdown ? ( - - - }> - - - Markdown Output - - - - - theme.palette.mode === 'dark' ? '#1e1e1e' : '#f5f5f5' - }} - > - - {markdownContent} - - - - + {hasMarkdown || hasHTML ? ( + <> + {hasMarkdown && ( + + }> + Markdown + + + + + {markdownContent} + + + + - - - - + + + )} + + {hasHTML && ( + + }> + HTML + + + + + {htmlContent} + + + + + + + + + )} + ) : ( - // Traditional robot output + // Extract robot output <> {row.status === 'running' || row.status === 'queued' ? ( <>