Skip to content

Commit 1667cf1

Browse files
committed
webui: Client-side implementation of tool calling with calculator tool and (javascript) code interpreter tool
1 parent 10b26ee commit 1667cf1

52 files changed

Lines changed: 6491 additions & 1912 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tools/server/public/index.html.gz

43.3 KB
Binary file not shown.

tools/server/webui/package-lock.json

Lines changed: 44 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/server/webui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@tailwindcss/forms": "^0.5.9",
4141
"@tailwindcss/typography": "^0.5.15",
4242
"@tailwindcss/vite": "^4.0.0",
43+
"@testing-library/svelte": "^5.2.9",
4344
"@types/node": "^24",
4445
"@vitest/browser": "^3.2.3",
4546
"@vitest/coverage-v8": "^3.2.3",

tools/server/webui/playwright.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { defineConfig } from '@playwright/test';
22

33
export default defineConfig({
44
webServer: {
5-
command: 'npm run build && http-server ../public -p 8181',
5+
command:
6+
'npm run build && gzip -dc ../public/index.html.gz > ../public/index.html && http-server ../public -p 8181',
67
port: 8181,
78
timeout: 120000,
89
reuseExistingServer: false

tools/server/webui/src/lib/components/app/chat/ChatForm/ChatForm.svelte

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
// Event Handlers
3939
onAttachmentRemove?: (index: number) => void;
4040
onFilesAdd?: (files: File[]) => void;
41+
onSend?: () => void;
4142
onStop?: () => void;
4243
onSubmit?: () => void;
4344
onSystemPromptClick?: (draft: { message: string; files: ChatUploadedFile[] }) => void;
@@ -55,13 +56,18 @@
5556
value = $bindable(''),
5657
onAttachmentRemove,
5758
onFilesAdd,
59+
onSend,
5860
onStop,
5961
onSubmit,
6062
onSystemPromptClick,
6163
onUploadedFileRemove,
6264
onValueChange
6365
}: Props = $props();
6466
67+
function submitMessage() {
68+
(onSubmit ?? onSend)?.();
69+
}
70+
6571
/**
6672
*
6773
*
@@ -215,7 +221,7 @@
215221
216222
if (!canSubmit || disabled || isLoading || hasLoadingAttachments) return;
217223
218-
onSubmit?.();
224+
submitMessage();
219225
}
220226
}
221227
@@ -321,7 +327,7 @@
321327
onsubmit={(e) => {
322328
e.preventDefault();
323329
if (!canSubmit || disabled || isLoading || hasLoadingAttachments) return;
324-
onSubmit?.();
330+
submitMessage();
325331
}}
326332
>
327333
<div

0 commit comments

Comments
 (0)