Skip to content

Commit 5fb1dec

Browse files
authored
Merge pull request #1270 from BudEcosystem/bugfix/agent-new
Bugfix/agent new
2 parents 561f3bf + 06f923e commit 5fb1dec

File tree

8 files changed

+1179
-168
lines changed

8 files changed

+1179
-168
lines changed

services/budadmin/src/components/ui/LogfireDateRangePicker.tsx

Lines changed: 481 additions & 0 deletions
Large diffs are not rendered by default.

services/budadmin/src/components/ui/bud/card/DrawerBreadCrumbNavigation.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,18 @@ export function DeawerCustomBreadcrumb({
106106
// Deploy Model
107107
function DrawerBreadCrumbNavigation({
108108
items: data,
109+
showMinimizeButton,
109110
}: {
110111
items: string[];
112+
showMinimizeButton?: boolean;
111113
}) {
112114
const { closeDrawer, setCancelAlert, step, minimizeProcess } = useDrawer();
113115
const { currentWorkflow } = useDeployModel();
114116
return (
115117
<div
116118
className=" ant-header-breadcrumb"
117119
>
118-
<div className="flex items-center gap-2">
120+
<div className="flex items-center gap-2 mr-4">
119121
<button onClick={(e) => {
120122
e.preventDefault();
121123
e.stopPropagation();
@@ -129,7 +131,8 @@ function DrawerBreadCrumbNavigation({
129131
<path fillRule="evenodd" clipRule="evenodd" d="M13.8103 5.09188C14.0601 4.8421 14.0601 4.43712 13.8103 4.18734C13.5606 3.93755 13.1556 3.93755 12.9058 4.18734L8.99884 8.0943L5.09188 4.18734C4.8421 3.93755 4.43712 3.93755 4.18734 4.18734C3.93755 4.43712 3.93755 4.8421 4.18734 5.09188L8.0943 8.99884L4.18734 12.9058C3.93755 13.1556 3.93755 13.5606 4.18734 13.8103C4.43712 14.0601 4.8421 14.0601 5.09188 13.8103L8.99884 9.90338L12.9058 13.8103C13.1556 14.0601 13.5606 14.0601 13.8103 13.8103C14.0601 13.5606 14.0601 13.1556 13.8103 12.9058L9.90338 8.99884L13.8103 5.09188Z" fill="#B3B3B3" />
130132
</svg>
131133
</button>
132-
<button onClick={() => {
134+
{showMinimizeButton && (
135+
<button onClick={() => {
133136
if (!currentWorkflow) {
134137
return closeDrawer();
135138
};
@@ -138,10 +141,11 @@ function DrawerBreadCrumbNavigation({
138141
...step,
139142
})
140143
}}>
141-
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" className="hover:text-[#FFFFFF] mr-4">
144+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" className="hover:text-[#FFFFFF] ">
142145
<path fillRule="evenodd" clipRule="evenodd" d="M15.5654 14.748C16.104 15.2866 15.2856 16.1044 14.747 15.5665L11.1293 11.9481V13.9429C11.1293 14.7044 9.972 14.7044 9.972 13.9429L9.9727 10.5517C9.9727 10.2325 10.2322 9.97302 10.5514 9.97302H13.9433C14.7048 9.97302 14.7048 11.1304 13.9433 11.1304L11.9478 11.1297L15.5654 14.748ZM7.6123 4.79945C7.6123 4.03796 8.76965 4.03796 8.76965 4.79945V8.19137C8.76965 8.51058 8.5102 8.77003 8.19099 8.77003L4.79907 8.76933C4.03758 8.76933 4.03758 7.61198 4.79907 7.61198H6.79383L3.17619 3.99434C2.63759 3.45574 3.45603 2.638 3.99463 3.1759L7.61227 6.79354L7.6123 4.79945Z" fill="#B3B3B3" />
143146
</svg>
144147
</button>
148+
)}
145149
</div>
146150
<DeawerCustomBreadcrumb data={data} />
147151
</div>

services/budadmin/src/components/ui/bud/dataEntry/BudForm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export interface BudFormProps extends FooterProps {
6565
drawerLoading?: boolean;
6666
onValuesChange?: (changedValues: any, allValues: any) => void;
6767
form?: FormInstance; // Allow passing form instance
68+
showMinimizeButton?: boolean;
6869
}
6970

7071

@@ -141,7 +142,7 @@ export function BudForm(props: BudFormProps) {
141142
className="ant-header-breadcrumb"
142143
>
143144
<Text_12_400_5B6168 className="h-[18px] py-[.7rem]"></Text_12_400_5B6168>
144-
</div> : <DrawerBreadCrumbNavigation items={step.navigation} />}
145+
</div> : <DrawerBreadCrumbNavigation items={step.navigation} showMinimizeButton={props.showMinimizeButton ?? true}/>}
145146
{isExpandedView ? null : cancelAlert && (<div className={`flex-initial z-20 border-1 border-[red] form-layout !mb-[0] top-[1rem] relative`}>
146147
<BudStepAlert
147148
cancelAction={() => {

services/budadmin/src/flows/Project/UseAgent.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ const generateJavaScriptCode = (apiUrl: string, config?: EndpointConfig) => {
5757
export default function UseAgent() {
5858
const { drawerProps } = useDrawer();
5959

60-
// Get prompt ID from the endpoint record passed via drawer props
61-
const promptId = drawerProps?.endpoint?.id || "PROMPT_ID";
60+
// Get prompt name from the endpoint record passed via drawer props
61+
const promptName = drawerProps?.endpoint?.name || "PROMPT_NAME";
6262

6363
// Use a single endpoint configuration for agents/prompts
6464
const endpointConfig = useMemo<EndpointConfig>(() => {
@@ -68,7 +68,7 @@ export default function UseAgent() {
6868
path: "/v1/responses",
6969
payload: {
7070
prompt: {
71-
id: promptId,
71+
id: promptName,
7272
version: "1",
7373
variables: {
7474
variable_1: "Value 1",
@@ -78,7 +78,7 @@ export default function UseAgent() {
7878
input: "Unstructured input text related to the prompt."
7979
},
8080
};
81-
}, [promptId]);
81+
}, [promptName]);
8282

8383
const baseUrl =
8484
process.env.NEXT_PUBLIC_COPY_CODE_API_BASE_URL ||

0 commit comments

Comments
 (0)