mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-04 10:52:17 +02:00
fix: support object and array parameters in custom HTTP tools (#373)
* fix: support object and array parameters in custom HTTP tools * feat(ui): expose object and array types in the custom tool parameter editor * fix: error handling and schema generation --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Abhishek Kumar <abhishek@a6k.me>
This commit is contained in:
parent
98d2b24cba
commit
dd85c4a1b4
18 changed files with 308 additions and 67 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import { PlusIcon, Trash2Icon } from "lucide-react";
|
||||
|
||||
import type { ToolParameter as ApiToolParameter } from "@/client/types.gen";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
|
|
@ -14,7 +15,7 @@ import {
|
|||
} from "@/components/ui/select";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
|
||||
export type ParameterType = "string" | "number" | "boolean";
|
||||
export type ParameterType = ApiToolParameter["type"];
|
||||
|
||||
export interface ToolParameter {
|
||||
name: string;
|
||||
|
|
@ -124,6 +125,8 @@ export function ParameterEditor({
|
|||
<SelectItem value="string">String</SelectItem>
|
||||
<SelectItem value="number">Number</SelectItem>
|
||||
<SelectItem value="boolean">Boolean</SelectItem>
|
||||
<SelectItem value="object">Object</SelectItem>
|
||||
<SelectItem value="array">Array</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
|
@ -267,6 +270,8 @@ export function PresetParameterEditor({
|
|||
<SelectItem value="string">String</SelectItem>
|
||||
<SelectItem value="number">Number</SelectItem>
|
||||
<SelectItem value="boolean">Boolean</SelectItem>
|
||||
<SelectItem value="object">Object</SelectItem>
|
||||
<SelectItem value="array">Array</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue