mirror of https://github.com/kortix-ai/suna.git
commit
7e47355289
|
@ -116,6 +116,24 @@ export function renderMarkdownContent(
|
||||||
|
|
||||||
toolCalls.forEach((toolCall, index) => {
|
toolCalls.forEach((toolCall, index) => {
|
||||||
const toolName = toolCall.functionName.replace(/_/g, '-');
|
const toolName = toolCall.functionName.replace(/_/g, '-');
|
||||||
|
|
||||||
|
if (toolName === 'ask') {
|
||||||
|
// Handle ask tool specially - extract text and attachments
|
||||||
|
const askText = toolCall.parameters.text || '';
|
||||||
|
const attachments = toolCall.parameters.attachments || [];
|
||||||
|
|
||||||
|
// Convert single attachment to array for consistent handling
|
||||||
|
const attachmentArray = Array.isArray(attachments) ? attachments :
|
||||||
|
(typeof attachments === 'string' ? attachments.split(',').map(a => a.trim()) : []);
|
||||||
|
|
||||||
|
// Render ask tool content with attachment UI
|
||||||
|
contentParts.push(
|
||||||
|
<div key={`ask-${match.index}-${index}`} className="space-y-3">
|
||||||
|
<Markdown className="text-sm prose prose-sm dark:prose-invert chat-markdown max-w-none break-words [&>:first-child]:mt-0 prose-headings:mt-3">{askText}</Markdown>
|
||||||
|
{renderAttachments(attachmentArray, fileViewerHandler, sandboxId, project)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
const IconComponent = getToolIcon(toolName);
|
const IconComponent = getToolIcon(toolName);
|
||||||
|
|
||||||
// Extract primary parameter for display
|
// Extract primary parameter for display
|
||||||
|
@ -144,6 +162,7 @@ export function renderMarkdownContent(
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
lastIndex = match.index + match[0].length;
|
lastIndex = match.index + match[0].length;
|
||||||
|
|
Loading…
Reference in New Issue