mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
refac
This commit is contained in:
parent
1c813902ec
commit
19957bc19b
1 changed files with 15 additions and 11 deletions
|
|
@ -99,14 +99,18 @@
|
|||
$: pendingToolTokens = tokens.filter(
|
||||
(t) => t?.attributes?.type === 'tool_calls' && t?.attributes?.status === 'pending'
|
||||
);
|
||||
$: hasActiveToolCalls = tokens.some(
|
||||
(t) =>
|
||||
t?.attributes?.type === 'tool_calls' &&
|
||||
t?.attributes?.status !== 'rejected' &&
|
||||
t?.attributes?.status !== 'failed' &&
|
||||
t?.attributes?.status !== 'incomplete' &&
|
||||
t?.attributes?.done !== 'true'
|
||||
);
|
||||
$: hasActiveDetails = tokens.some((token) => {
|
||||
const attributes = token?.attributes;
|
||||
if (attributes?.type === 'tool_calls') {
|
||||
return (
|
||||
attributes.status !== 'rejected' &&
|
||||
attributes.status !== 'failed' &&
|
||||
attributes.status !== 'incomplete' &&
|
||||
attributes.done !== 'true'
|
||||
);
|
||||
}
|
||||
return !messageDone && attributes?.done && attributes.done !== 'true';
|
||||
});
|
||||
$: hasRejected = tokens.some(
|
||||
(t) => t?.attributes?.type === 'tool_calls' && t?.attributes?.status === 'rejected'
|
||||
);
|
||||
|
|
@ -174,7 +178,7 @@
|
|||
return detail;
|
||||
})();
|
||||
|
||||
$: prefixText = hasActiveToolCalls ? $i18n.t('Exploring') : $i18n.t('Explored');
|
||||
$: prefixText = hasActiveDetails ? $i18n.t('Exploring') : $i18n.t('Explored');
|
||||
</script>
|
||||
|
||||
<div {id} class="w-full min-w-0">
|
||||
|
|
@ -199,7 +203,7 @@
|
|||
>
|
||||
<div class="flex items-center gap-1.5 min-w-0">
|
||||
<!-- Status icon -->
|
||||
{#if hasActiveToolCalls}
|
||||
{#if hasActiveDetails}
|
||||
<div>
|
||||
<Spinner className="size-4" />
|
||||
</div>
|
||||
|
|
@ -223,7 +227,7 @@
|
|||
|
||||
<!-- Summary text -->
|
||||
<div class="flex-1 line-clamp-1">
|
||||
<span class="text-gray-600 dark:text-gray-300 {hasActiveToolCalls ? 'shimmer' : ''}"
|
||||
<span class="text-gray-600 dark:text-gray-300 {hasActiveDetails ? 'shimmer' : ''}"
|
||||
>{prefixText}</span
|
||||
>
|
||||
{#if summaryText}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue