diff --git a/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx b/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx index b2caf80a..940c1716 100644 --- a/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx +++ b/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx @@ -31,7 +31,7 @@ const sectionHeaderStyles = "text-xs font-medium uppercase tracking-wider text-g const textareaStyles = "rounded-lg p-3 border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-750 focus:shadow-inner focus:ring-2 focus:ring-indigo-500/20 dark:focus:ring-indigo-400/20 placeholder:text-gray-400 dark:placeholder:text-gray-500"; // Add this type definition after the imports -type TabType = 'instructions' | 'examples' | 'configurations'; +type TabType = 'instructions' | 'examples' | 'configurations' | 'rag'; export function AgentConfig({ projectId, @@ -186,7 +186,7 @@ export function AgentConfig({
{/* Tabs */}
- {(['instructions', 'examples', 'configurations'] as TabType[]).map((tab) => ( + {(['instructions', 'examples', 'configurations', 'rag'] as TabType[]).map((tab) => ( ))}
@@ -483,180 +483,6 @@ export function AgentConfig({ />
- {useRag && ( -
- -
-
- - - {showRagCta && ( - - Update Instructions - - )} -
- -
- {(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) -

-
-
-
- )} -
- - )} -
-
- )} -
)} + + {activeTab === 'rag' && useRag && ( +
+
+
+ +
+ + + {showRagCta && ( + + Update Instructions + + )} +
+
+ +
+ {(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) +

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