diff --git a/apps/rowboat/app/lib/components/dropdown.tsx b/apps/rowboat/app/lib/components/dropdown.tsx index bf41a941..e0ea79b8 100644 --- a/apps/rowboat/app/lib/components/dropdown.tsx +++ b/apps/rowboat/app/lib/components/dropdown.tsx @@ -1,4 +1,4 @@ -import { Select, SelectItem } from "@heroui/react"; +import { Select, SelectItem, Button } from "@heroui/react"; import { ReactNode } from "react"; export interface DropdownOption { @@ -8,24 +8,27 @@ export interface DropdownOption { interface DropdownProps { options: DropdownOption[]; - value: string; + value?: string; onChange: (value: string) => void; className?: string; + placeholder?: string; } export function Dropdown({ options, value, onChange, - className = "w-60" + className = "w-60", + placeholder }: DropdownProps) { return ( { + const key = keys.currentKey as string; + if (key) { + handleUpdate({ + ...agent, + ragDataSources: [...(agent.ragDataSources || []), key] + }); + } + }} + startContent={} + > + {dataSources + .filter((ds) => !(agent.ragDataSources || []).includes(ds._id)) + .map((ds) => ( + + {ds.name} + + )) + } + + + +
+ {(agent.ragDataSources || []).map((source) => { + const ds = dataSources.find((ds) => ds._id === source); + return ( +
+
+
+ + + +
+
+ + {ds?.name || "Unknown"} + + + Data Source + +
+
+ { + const newSources = agent.ragDataSources?.filter((s) => s !== source); + handleUpdate({ + ...agent, + ragDataSources: newSources + }); + }} + startContent={} + > + Remove + +
+ ); + })} +
+ + {agent.ragDataSources !== undefined && agent.ragDataSources.length > 0 && ( + <> +
+ + + {isAdvancedConfigOpen && ( +
+
+
+ +
+ {["chunks", "content"].map((type) => ( + + ))} +
+
+ +
+ +
+ handleUpdate({ + ...agent, + ragK: parseInt(e.target.value) + })} + /> + + matches + +
+

+ Number of relevant chunks to retrieve (1-20) +

+
+
+
+ )} +
+ + )} )}