mirror of
https://github.com/open-webui/computer.git
synced 2026-12-02 17:57:59 -05:00
refac
This commit is contained in:
1 parent
1e14d49de2
commit
c8f530cbbc
8 files changed
+146
-59
No files matched your search
@@ -8,7 +8,6 @@
|
||||
import MessageTimestamp from './MessageTimestamp.svelte';
|
||||
import ReasoningCollapsible from './ReasoningCollapsible.svelte';
|
||||
import ToolCallCollapsible from './ToolCallCollapsible.svelte';
|
||||
import AskUserCard from './AskUserCard.svelte';
|
||||
import { currentWorkspace, openFileTab } from '$lib/stores';
|
||||
import { ttsConfigured, ttsEnabled } from '$lib/stores/audio';
|
||||
import { tooltip } from '$lib/tooltip';
|
||||
@@ -28,12 +27,6 @@
|
||||
siblingTotal?: number;
|
||||
speaking?: boolean;
|
||||
onapprove: (messageId: string, callId: string, approved: boolean) => void;
|
||||
onanswer: (
|
||||
messageId: string,
|
||||
callId: string,
|
||||
answers: Record<string, string>,
|
||||
timedOut: boolean
|
||||
) => void;
|
||||
onnavigate?: (direction: -1 | 1) => void;
|
||||
onfork?: () => void;
|
||||
onregenerate?: () => void;
|
||||
@@ -52,7 +45,6 @@
|
||||
siblingTotal = 1,
|
||||
speaking = false,
|
||||
onapprove,
|
||||
onanswer,
|
||||
onnavigate,
|
||||
onfork,
|
||||
onregenerate,
|
||||
@@ -270,19 +262,7 @@
|
||||
index: number;
|
||||
}
|
||||
|
||||
interface AskUserItem {
|
||||
type: 'ask_user_item';
|
||||
item: any;
|
||||
output: any;
|
||||
}
|
||||
|
||||
type DisplayItem =
|
||||
| ActivityGroup
|
||||
| MessageItem
|
||||
| ArtifactItem
|
||||
| ImageItem
|
||||
| FileItem
|
||||
| AskUserItem;
|
||||
type DisplayItem = ActivityGroup | MessageItem | ArtifactItem | ImageItem | FileItem;
|
||||
|
||||
const outputText = $derived.by((): string => {
|
||||
return (output || [])
|
||||
@@ -363,10 +343,7 @@
|
||||
|
||||
for (const [index, item] of output.entries()) {
|
||||
if (item.type === 'function_call') {
|
||||
if (item.name === 'ask_user') {
|
||||
flushGroup();
|
||||
items.push({ type: 'ask_user_item', item, output: outputMap.get(item.call_id) });
|
||||
} else {
|
||||
if (item.name !== 'ask_user') {
|
||||
ensureGroup();
|
||||
currentGroup!.entries.push(item);
|
||||
currentGroup!.calls.push(item);
|
||||
@@ -572,14 +549,6 @@
|
||||
<ChatFilePreview {file} {filePath} />
|
||||
{/if}
|
||||
</div>
|
||||
{:else if displayItem.type === 'ask_user_item'}
|
||||
<AskUserCard
|
||||
item={displayItem.item}
|
||||
pairedOutput={displayItem.output}
|
||||
{chatId}
|
||||
{messageId}
|
||||
{onanswer}
|
||||
/>
|
||||
{:else if displayItem.type === 'activity_group'}
|
||||
{#if displayItem.entries.length === 1}
|
||||
{@const item = displayItem.entries[0]}
|
||||
|
||||
Reference in new issue
Block a user