This commit is contained in:
seb
2026-10-07 19:47:19 +02:00
parent 4cc8c49cf1
commit 79e67f2be6

View File

@@ -119,7 +119,7 @@ function formatUsageText(usage) {
return `${fmt(input)} Prompt${cachedPart} · ${fmt(output)} Antwort${cost}`; return `${fmt(input)} Prompt${cachedPart} · ${fmt(output)} Antwort${cost}`;
} }
function formatToolTooltip(content, result, parameters, prefix) { function formatToolTooltip(content, result, parameters, prefix, error) {
const parts = []; const parts = [];
if (prefix) { if (prefix) {
@@ -150,13 +150,32 @@ function formatToolTooltip(content, result, parameters, prefix) {
} }
} }
if (result !== undefined && result !== null) { if (result !== undefined && result !== null && result !== '') {
try { try {
const resStr = typeof result === 'object' ? JSON.stringify(result, null, 2) : String(result); const resStr = typeof result === 'object' ? JSON.stringify(result, null, 2) : String(result);
if (!parts.some((p) => p.includes(resStr))) { if (!parts.includes(resStr)) {
parts.push(resStr); parts.push(resStr);
} }
} catch {} } catch {
const resStr = String(result);
if (!parts.includes(resStr)) {
parts.push(resStr);
}
}
}
if (error !== undefined && error !== null && error !== '') {
try {
const errStr = typeof error === 'object' ? JSON.stringify(error, null, 2) : String(error);
if (!parts.includes(errStr)) {
parts.push(errStr);
}
} catch {
const errStr = String(error);
if (!parts.includes(errStr)) {
parts.push(errStr);
}
}
} }
return parts.join('\n\n') || ''; return parts.join('\n\n') || '';
@@ -188,7 +207,6 @@ class ClickTooltip extends PureComponent {
enterDelay={0} enterDelay={0}
leaveDelay={0} leaveDelay={0}
TransitionProps={{ timeout: 0 }} TransitionProps={{ timeout: 0 }}
slotProps={{ transition: { timeout: 0 } }}
title={title} title={title}
arrow arrow
placement="top" placement="top"