Spaces:
Running
Running
fix(tools): show error in inputs
Browse files
src/lib/server/tools/index.ts
CHANGED
@@ -61,7 +61,7 @@ const toolInputSchema = toolInputBaseSchema.and(
|
|
61 |
z.object({ type: IOType }).or(
|
62 |
z.object({
|
63 |
type: z.literal("file"),
|
64 |
-
mimeTypes: z.string().
|
65 |
})
|
66 |
)
|
67 |
);
|
|
|
61 |
z.object({ type: IOType }).or(
|
62 |
z.object({
|
63 |
type: z.literal("file"),
|
64 |
+
mimeTypes: z.string().min(1),
|
65 |
})
|
66 |
)
|
67 |
);
|
src/routes/tools/ToolEdit.svelte
CHANGED
@@ -367,6 +367,10 @@
|
|
367 |
</p>
|
368 |
</div>
|
369 |
|
|
|
|
|
|
|
|
|
370 |
{#each editableTool.inputs as input, inputIdx}
|
371 |
{@const parameter = endpoint.parameters.find(
|
372 |
(parameter) => parameter.parameter_name === input.name
|
@@ -435,9 +439,6 @@
|
|
435 |
bind:value={input.description}
|
436 |
disabled={readonly}
|
437 |
/>
|
438 |
-
<p class="text-xs text-red-500">
|
439 |
-
{getError(`${input.name}-description`, form)}
|
440 |
-
</p>
|
441 |
</label>
|
442 |
{/if}
|
443 |
{#if input.paramType === "optional" || input.paramType === "fixed"}
|
@@ -467,9 +468,6 @@
|
|
467 |
bind:value={input.value}
|
468 |
/>
|
469 |
{/if}
|
470 |
-
<p class="text-xs text-red-500">
|
471 |
-
{getError(`${input.name}-${isOptional ? "default" : "value"}`, form)}
|
472 |
-
</p>
|
473 |
</div>
|
474 |
{/if}
|
475 |
{#if input.type === "file"}
|
|
|
367 |
</p>
|
368 |
</div>
|
369 |
|
370 |
+
<p class="text-xs text-red-500">
|
371 |
+
{getError(`inputs`, form)}
|
372 |
+
</p>
|
373 |
+
|
374 |
{#each editableTool.inputs as input, inputIdx}
|
375 |
{@const parameter = endpoint.parameters.find(
|
376 |
(parameter) => parameter.parameter_name === input.name
|
|
|
439 |
bind:value={input.description}
|
440 |
disabled={readonly}
|
441 |
/>
|
|
|
|
|
|
|
442 |
</label>
|
443 |
{/if}
|
444 |
{#if input.paramType === "optional" || input.paramType === "fixed"}
|
|
|
468 |
bind:value={input.value}
|
469 |
/>
|
470 |
{/if}
|
|
|
|
|
|
|
471 |
</div>
|
472 |
{/if}
|
473 |
{#if input.type === "file"}
|