diff --git a/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx b/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx index c748c79e..0b0e4dbb 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 = "block text-xs font-medium uppercase tracking-wider 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' | 'rag'; +type TabType = 'instructions' | 'configurations'; export function AgentConfig({ projectId, @@ -195,7 +195,7 @@ export function AgentConfig({
{/* Tabs */}
- {(['instructions', 'examples', 'configurations', 'rag'] as TabType[]).map((tab) => ( + {(['instructions', 'configurations'] as TabType[]).map((tab) => ( ))}
@@ -215,60 +215,23 @@ export function AgentConfig({
{activeTab === 'instructions' && ( <> -
-
- - setIsInstructionsMaximized(!isInstructionsMaximized)} - showHoverContent={true} - hoverContent={isInstructionsMaximized ? "Minimize" : "Maximize"} - > - {isInstructionsMaximized ? ( - - ) : ( - - )} - -
- setShowGenerateModal(true)} - startContent={} - > - Generate - -
{isInstructionsMaximized ? (
- - setIsInstructionsMaximized(false)} - showHoverContent={true} - hoverContent="Minimize" - > - - + {agent.name} + / + Instructions
- setShowGenerateModal(true)} - startContent={} +
) : ( - { - handleUpdate({ - ...agent, - instructions: value - }); - }} - markdown - multiline - mentions - mentionsAtValues={atMentions} - showSaveButton={true} - showDiscardButton={true} - className="h-full min-h-0 overflow-auto" - /> - )} - - )} - - {activeTab === 'examples' && ( - <> -
-
- - setIsExamplesMaximized(!isExamplesMaximized)} - showHoverContent={true} - hoverContent={isExamplesMaximized ? "Minimize" : "Maximize"} - > - {isExamplesMaximized ? ( - - ) : ( - - )} - -
-
- {isExamplesMaximized ? ( -
-
-
+
+ {/* Instructions Section */} +
+
- - setIsExamplesMaximized(false)} - showHoverContent={true} - hoverContent="Minimize" + +
+ setShowGenerateModal(true)} + startContent={} + > + Generate +
-
+ { + handleUpdate({ + ...agent, + instructions: value + }); + }} + markdown + multiline + mentions + mentionsAtValues={atMentions} + showSaveButton={true} + showDiscardButton={true} + className="h-full min-h-0 overflow-auto !mb-0 !mt-0" + /> +
+ {/* Examples Section */} +
+
+ + +
+ {isExamplesMaximized ? ( +
+
+
+
+ {agent.name} + / + Examples +
+ +
+
+ { + handleUpdate({ + ...agent, + examples: value + }); + }} + placeholder="Enter examples for this agent" + markdown + multiline + mentions + mentionsAtValues={atMentions} + showSaveButton={true} + showDiscardButton={true} + className="h-full min-h-0 overflow-auto !mb-0 !mt-0" + /> +
+
+
+ ) : ( { handleUpdate({ @@ -371,34 +375,17 @@ export function AgentConfig({ mentionsAtValues={atMentions} showSaveButton={true} showDiscardButton={true} - className="h-full min-h-0 overflow-auto" + className="h-full min-h-0 overflow-auto !mb-0 !mt-0" /> -
+ )}
- ) : ( - { - handleUpdate({ - ...agent, - examples: value - }); - }} - placeholder="Enter examples for this agent" - markdown - multiline - mentions - mentionsAtValues={atMentions} - showSaveButton={true} - showDiscardButton={true} - className="h-full min-h-0 overflow-auto" - /> )} )} + + {activeTab === 'configurations' && (
{!agent.locked && ( @@ -634,184 +621,186 @@ export function AgentConfig({ />
)} -
- )} - {activeTab === 'rag' && useRag && ( -
-
-
- -
- - - {showRagCta && ( - +
+
+ +
+
+ -
- -
- handleUpdate({ - ...agent, - ragK: parseInt(e.target.value) - })} - /> - - matches - -
-

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

-
-
-
+ {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) +

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