fix: restore image outputs from tool calls (#1640)
This commit is contained in:
@@ -130,12 +130,23 @@ function ToolResultView({ result }: ToolResultViewProps) {
|
|||||||
)}
|
)}
|
||||||
{(isExpanded || !shouldMinimize) && (
|
{(isExpanded || !shouldMinimize) && (
|
||||||
<>
|
<>
|
||||||
{item.text && (
|
{item.type === 'text' && item.text && (
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
content={item.text}
|
content={item.text}
|
||||||
className="whitespace-pre-wrap p-2 max-w-full overflow-x-auto"
|
className="whitespace-pre-wrap p-2 max-w-full overflow-x-auto"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{item.type === 'image' && (
|
||||||
|
<img
|
||||||
|
src={`data:${item.mimeType};base64,${item.data}`}
|
||||||
|
alt="Tool result"
|
||||||
|
className="max-w-full h-auto rounded-md my-2"
|
||||||
|
onError={(e) => {
|
||||||
|
console.error('Failed to load image: Invalid MIME-type encoded image data');
|
||||||
|
e.currentTarget.style.display = 'none';
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user