MBG0903 commited on
Commit
7e78b27
·
verified ·
1 Parent(s): a626c6f

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -129
app.py DELETED
@@ -1,129 +0,0 @@
1
- import gradio as gr
2
- import pandas as pd
3
-
4
- from agents.brain import AutoWarehouseAgent
5
-
6
-
7
- PRIMARY_COLOR = "#FF6A00"
8
-
9
-
10
- # ----------------------------------------------------------------------
11
- # Load agent
12
- # ----------------------------------------------------------------------
13
- agent = AutoWarehouseAgent()
14
-
15
-
16
- # ----------------------------------------------------------------------
17
- # Utility: Convert Gradio DataFrame to Pandas
18
- # ----------------------------------------------------------------------
19
- def df_from_gr_input(df):
20
- if df is None:
21
- return pd.DataFrame()
22
- return pd.DataFrame(df)
23
-
24
-
25
- # ----------------------------------------------------------------------
26
- # Main function called by Gradio
27
- # ----------------------------------------------------------------------
28
- def run_agent(user_query, slotting_table, picking_table):
29
- slotting_df = df_from_gr_input(slotting_table)
30
- picking_df = df_from_gr_input(picking_table)
31
-
32
- result = agent.run(
33
- user_query=user_query,
34
- slotting_df=slotting_df,
35
- picking_df=picking_df
36
- )
37
-
38
- return result
39
-
40
-
41
- # ----------------------------------------------------------------------
42
- # UI Layout
43
- # ----------------------------------------------------------------------
44
- def build_ui():
45
-
46
- with gr.Blocks() as demo:
47
-
48
- gr.Markdown(
49
- f"""
50
- <h1 style='color:{PRIMARY_COLOR}; font-weight:900;'>Procelevate Autonomous Warehouse Operator</h1>
51
- <p style='font-size:18px'>
52
- Enterprise-grade Agentic AI that optimizes slotting, picking, and warehouse operations.
53
- </p>
54
- """,
55
- )
56
-
57
- # ------------------- USER INPUT -------------------- #
58
- user_query = gr.Textbox(
59
- label="Ask the Warehouse Operator",
60
- placeholder="e.g., Generate full warehouse operations report",
61
- )
62
-
63
- gr.Markdown("### Slotting Data")
64
- slotting_table = gr.Dataframe(
65
- headers=["SKU", "Velocity", "Frequency"],
66
- datatype=["str", "str", "number"],
67
- row_count=5,
68
- col_count=3,
69
- value=[
70
- ["A123", "Fast", 120],
71
- ["B555", "Medium", 60],
72
- ["C888", "Slow", 8],
73
- ],
74
- )
75
-
76
- gr.Markdown("### Picking Path Data")
77
- picking_table = gr.Dataframe(
78
- headers=["Aisle", "Rack"],
79
- datatype=["number", "number"],
80
- row_count=5,
81
- col_count=2,
82
- value=[
83
- [5, 14],
84
- [3, 10],
85
- [12, 7],
86
- ],
87
- )
88
-
89
- run_button = gr.Button(
90
- "Run Agent",
91
- variant="primary",
92
- elem_id="run-btn"
93
- )
94
-
95
- output_report = gr.Markdown(
96
- value="",
97
- elem_id="report-area"
98
- )
99
-
100
- # ------------------- CSS -------------------- #
101
- gr.HTML(
102
- f"""
103
- <style>
104
- #run-btn {{
105
- background-color: {PRIMARY_COLOR} !important;
106
- color: white !important;
107
- height: 60px;
108
- font-size: 20px;
109
- border-radius: 8px;
110
- }}
111
- </style>
112
- """
113
- )
114
-
115
- # ------------------- LINK BUTTON -------------------- #
116
- run_button.click(
117
- fn=run_agent,
118
- inputs=[user_query, slotting_table, picking_table],
119
- outputs=[output_report],
120
- )
121
-
122
- return demo
123
-
124
-
125
- # ----------------------------------------------------------------------
126
- # Launch App
127
- # ----------------------------------------------------------------------
128
- demo = build_ui()
129
- demo.launch()