Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -216,63 +216,34 @@ CONVERSATION STYLE:
|
|
| 216 |
return "", history
|
| 217 |
|
| 218 |
# === Gradio UI ===
|
| 219 |
-
with gr.Blocks(
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
)
|
| 231 |
-
|
| 232 |
-
)
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 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()
|