Skip to content

Commit

Permalink
fix(tools): show error in inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarrazin committed Aug 15, 2024
1 parent 8c75fa2 commit eee8525
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/lib/server/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const toolInputSchema = toolInputBaseSchema.and(
z.object({ type: IOType }).or(
z.object({
type: z.literal("file"),
mimeTypes: z.string().nonempty(),
mimeTypes: z.string().min(1),
})
)
);
Expand Down
10 changes: 4 additions & 6 deletions src/routes/tools/ToolEdit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,10 @@
</p>
</div>

<p class="text-xs text-red-500">
{getError(`inputs`, form)}
</p>

{#each editableTool.inputs as input, inputIdx}
{@const parameter = endpoint.parameters.find(
(parameter) => parameter.parameter_name === input.name
Expand Down Expand Up @@ -435,9 +439,6 @@
bind:value={input.description}
disabled={readonly}
/>
<p class="text-xs text-red-500">
{getError(`${input.name}-description`, form)}
</p>
</label>
{/if}
{#if input.paramType === "optional" || input.paramType === "fixed"}
Expand Down Expand Up @@ -467,9 +468,6 @@
bind:value={input.value}
/>
{/if}
<p class="text-xs text-red-500">
{getError(`${input.name}-${isOptional ? "default" : "value"}`, form)}
</p>
</div>
{/if}
{#if input.type === "file"}
Expand Down

0 comments on commit eee8525

Please sign in to comment.