feat: add text and generation tools

This commit is contained in:
2026-08-26 16:08:27 +05:00
parent 56ebe5b53b
commit 2b67414e79
14 changed files with 734 additions and 22 deletions
+14 -1
View File
@@ -153,9 +153,22 @@
}
async function handleTextSubmit(text: string) {
if (!isTextSource || !tool.runFromText) return;
if (!isTextSource) return;
errorText = '';
status = 'processing';
if (tool.textToText) {
try {
result = null;
previewResult = null;
info = null;
textResult = await tool.textToText(text);
status = 'loaded';
} catch (e) {
showError(e);
}
return;
}
if (!tool.runFromText) return;
try {
source = await tool.runFromText(text, defaultParams(tool));
values = defaultParams(tool);
@@ -15,7 +15,7 @@
let { onSelect, chainableOnly = false }: Props = $props();
const candidates = chainableOnly ? TOOLS.filter(isChainable) : TOOLS;
const candidates = $derived(chainableOnly ? TOOLS.filter(isChainable) : TOOLS);
let query = $state('');
let activeIndex = $state(0);