SysModeler commited on
Commit
3c3e008
Β·
verified Β·
1 Parent(s): cd9520a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -53
app.py CHANGED
@@ -216,63 +216,34 @@ CONVERSATION STYLE:
216
  return "", history
217
 
218
  # === Gradio UI ===
219
- with gr.Blocks(
220
- title="SysModeler AI Assistant",
221
- theme=gr.themes.Base(
222
- primary_hue="blue",
223
- secondary_hue="cyan",
224
- neutral_hue="slate"
225
- ).set(
226
- body_background_fill="*neutral_950",
227
- body_text_color="*neutral_100",
228
- background_fill_primary="*neutral_900",
229
- background_fill_secondary="*neutral_800"
230
- ),
231
- css="""[PASTE YOUR CSS BLOCK HERE]"""
232
- ) as demo:
233
- with gr.Column(elem_classes="main-container"):
234
- with gr.Column(elem_classes="header-section"):
235
- gr.Markdown("# πŸ€– SysModeler AI Assistant", elem_classes="main-title")
236
- gr.Markdown("*Your intelligent companion for SysML modeling and systems engineering*", elem_classes="subtitle")
237
- with gr.Column(elem_classes="content-area"):
238
- with gr.Column(elem_classes="chat-section"):
239
- with gr.Column(elem_classes="chat-container"):
240
- chatbot = gr.Chatbot(
241
- height=580,
242
- elem_classes="chatbot",
243
- avatar_images=None,
244
- bubble_full_width=False,
245
- show_copy_button=True,
246
- show_share_button=False
247
- )
248
- with gr.Column(elem_classes="input-section"):
249
- with gr.Column():
250
- with gr.Row(elem_classes="input-row"):
251
- msg = gr.Textbox(
252
- placeholder="Ask me about SysML diagrams, modeling concepts, or tools...",
253
- lines=3,
254
- show_label=False,
255
- elem_classes="input-textbox",
256
- container=False
257
- )
258
- submit_btn = gr.Button("Send", elem_id="submit-btn")
259
- with gr.Row(elem_classes="quick-actions"):
260
- quick_intro = gr.Button("πŸ“š SysML Introduction", elem_classes="quick-action-btn")
261
- quick_diagrams = gr.Button("πŸ“Š Diagram Types", elem_classes="quick-action-btn")
262
- quick_tools = gr.Button("πŸ› οΈ Tool Comparison", elem_classes="quick-action-btn")
263
- quick_sysmodeler = gr.Button("⭐ SysModeler Features", elem_classes="quick-action-btn")
264
- with gr.Row(elem_classes="control-buttons"):
265
- clear = gr.Button("Clear", elem_id="clear-btn")
266
- with gr.Column(elem_classes="footer"):
267
- gr.Markdown("*Powered by Azure OpenAI & Advanced RAG Technology*")
268
  state = gr.State([])
 
269
  submit_btn.click(fn=sysml_chatbot, inputs=[msg, state], outputs=[msg, chatbot])
270
  msg.submit(fn=sysml_chatbot, inputs=[msg, state], outputs=[msg, chatbot])
271
  clear.click(fn=lambda: ([], ""), inputs=None, outputs=[chatbot, msg])
272
- quick_intro.click(fn=lambda: ("What is SysML and how do I get started?", []), outputs=[msg, chatbot])
273
- quick_diagrams.click(fn=lambda: ("Explain the 9 SysML diagram types with examples", []), outputs=[msg, chatbot])
274
- quick_tools.click(fn=lambda: ("What are the best SysML modeling tools available?", []), outputs=[msg, chatbot])
275
- quick_sysmodeler.click(fn=lambda: ("Tell me about SysModeler.ai features and capabilities", []), outputs=[msg, chatbot])
276
 
277
  if __name__ == "__main__":
278
  demo.launch()
 
216
  return "", history
217
 
218
  # === Gradio UI ===
219
+ with gr.Blocks(css="""
220
+ #submit-btn {
221
+ height: 100%;
222
+ background-color: #48CAE4;
223
+ color: white;
224
+ font-size: 1.5em;
225
+ }
226
+ """) as demo:
227
+
228
+ gr.Markdown("## SysModeler Chatbot")
229
+
230
+ chatbot = gr.Chatbot(height=600)
231
+ with gr.Row():
232
+ with gr.Column(scale=5):
233
+ msg = gr.Textbox(
234
+ placeholder="Ask me about SysML diagrams or concepts...",
235
+ lines=3,
236
+ show_label=False
237
+ )
238
+ with gr.Column(scale=1, min_width=50):
239
+ submit_btn = gr.Button("➀", elem_id="submit-btn")
240
+
241
+ clear = gr.Button("Clear")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  state = gr.State([])
243
+
244
  submit_btn.click(fn=sysml_chatbot, inputs=[msg, state], outputs=[msg, chatbot])
245
  msg.submit(fn=sysml_chatbot, inputs=[msg, state], outputs=[msg, chatbot])
246
  clear.click(fn=lambda: ([], ""), inputs=None, outputs=[chatbot, msg])
 
 
 
 
247
 
248
  if __name__ == "__main__":
249
  demo.launch()