Skip to content

Commit

Permalink
Main code brought in
Browse files Browse the repository at this point in the history
  • Loading branch information
overmode committed Dec 31, 2024
1 parent feb3737 commit 5e29780
Show file tree
Hide file tree
Showing 5 changed files with 401 additions and 42 deletions.
55 changes: 30 additions & 25 deletions front/components/assistant_builder/AssistantBuilder.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "react-image-crop/dist/ReactCrop.css";

import {
BarChartIcon,
Button,
ChatBubbleBottomCenterTextIcon,
ChevronLeftIcon,
Expand Down Expand Up @@ -500,6 +501,7 @@ export default function AssistantBuilder({
}
buttonsRightPanel={
<>
{/* Chevron button */}
<Button
size="sm"
variant="ghost"
Expand All @@ -511,39 +513,41 @@ export default function AssistantBuilder({
disabled={isBuilderStateEmpty}
onClick={toggleRightPanel}
/>
{rightPanelStatus.tab === null && template === null && (
<Button
icon={ChatBubbleBottomCenterTextIcon}
onClick={() => openRightPanelTab("Preview")}
size="md"
tooltip={
isBuilderStateEmpty
? "Add instructions or tools to Preview"
: "Preview"
}
variant="highlight"
disabled={isBuilderStateEmpty}
className={cn(
isPreviewButtonAnimating && "animate-breathing-scale"
)}
/>
)}
{rightPanelStatus.tab === null && template !== null && (
{rightPanelStatus.tab === null && (
<div className="flex flex-col gap-3">
{/* Preview Button */}
<Button
icon={ChatBubbleBottomCenterTextIcon}
onClick={() => openRightPanelTab("Preview")}
size="sm"
variant="outline"
tooltip="Preview your assistant"
className={cn(
isPreviewButtonAnimating && "animate-breathing-scale"
)}
disabled={isBuilderStateEmpty}
/>
<Button
icon={MagicIcon}
onClick={() => openRightPanelTab("Template")}
size="sm"
variant="outline"
tooltip="Template instructions"
/>
{/* Performance Button */}
{!!agentConfigurationId && (
<Button
icon={BarChartIcon}
onClick={() => openRightPanelTab("Performance")}
size="sm"
variant="outline"
tooltip="Inspect feedback and performance"
disabled={!agentConfigurationId}
/>
)}
{/* Template Button */}
{template !== null && (
<Button
icon={MagicIcon}
onClick={() => openRightPanelTab("Template")}
size="sm"
variant="outline"
tooltip="Template instructions"
/>
)}
</div>
)}
</>
Expand All @@ -565,6 +569,7 @@ export default function AssistantBuilder({
rightPanelStatus={rightPanelStatus}
openRightPanelTab={openRightPanelTab}
builderState={builderState}
agentConfigurationId={agentConfigurationId}
setAction={setAction}
/>
}
Expand Down
Loading

0 comments on commit 5e29780

Please sign in to comment.