Update app.py
Browse files
app.py
CHANGED
|
@@ -484,8 +484,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="AI Coordination System") as ui:
|
|
| 484 |
email_input = gr.Textbox(
|
| 485 |
label="Administration Report Email",
|
| 486 |
value=get_current_email,
|
| 487 |
-
placeholder="admin@company.com"
|
| 488 |
-
info="All coordination reports will be sent here"
|
| 489 |
)
|
| 490 |
email_status = gr.Textbox(
|
| 491 |
label="Email Status",
|
|
@@ -493,7 +492,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="AI Coordination System") as ui:
|
|
| 493 |
interactive=False,
|
| 494 |
max_lines=2
|
| 495 |
)
|
| 496 |
-
update_email_btn = gr.Button("
|
| 497 |
|
| 498 |
gr.Markdown("---")
|
| 499 |
gr.Markdown("### π€ Coordination Request Form")
|
|
@@ -502,14 +501,12 @@ with gr.Blocks(theme=gr.themes.Soft(), title="AI Coordination System") as ui:
|
|
| 502 |
gr.Markdown("#### Personal Information")
|
| 503 |
name_input = gr.Textbox(
|
| 504 |
label="Your Full Name",
|
| 505 |
-
placeholder="Enter your full name"
|
| 506 |
-
info="This will be included in coordination requests"
|
| 507 |
)
|
| 508 |
|
| 509 |
department_dropdown = gr.Dropdown(
|
| 510 |
choices=["administration", "production", "magazine"],
|
| 511 |
-
label="Your Department"
|
| 512 |
-
info="Select which department you're representing"
|
| 513 |
)
|
| 514 |
|
| 515 |
with gr.Group():
|
|
@@ -517,47 +514,40 @@ with gr.Blocks(theme=gr.themes.Soft(), title="AI Coordination System") as ui:
|
|
| 517 |
message_input = gr.Textbox(
|
| 518 |
label="Coordination Message",
|
| 519 |
lines=4,
|
| 520 |
-
placeholder="Describe what you need from other departments..."
|
| 521 |
-
max_lines=6,
|
| 522 |
-
info="Be specific about what coordination you need"
|
| 523 |
)
|
| 524 |
|
| 525 |
image_input = gr.Image(
|
| 526 |
-
label="
|
| 527 |
-
type="pil"
|
| 528 |
-
height=200,
|
| 529 |
-
info="Upload diagrams, photos, or documents as images for the AI to analyze"
|
| 530 |
)
|
| 531 |
|
| 532 |
with gr.Group():
|
| 533 |
gr.Markdown("#### Email Options")
|
| 534 |
recipient_dropdown = gr.Dropdown(
|
| 535 |
choices=["administration", "production", "magazine"],
|
| 536 |
-
label="Recipient Department"
|
| 537 |
-
info="Select which department to email"
|
| 538 |
)
|
| 539 |
|
| 540 |
urgency_dropdown = gr.Dropdown(
|
| 541 |
choices=["Normal", "Medium", "High"],
|
| 542 |
value="Normal",
|
| 543 |
-
label="Urgency Level"
|
| 544 |
-
info="Set email priority"
|
| 545 |
)
|
| 546 |
|
| 547 |
send_email_checkbox = gr.Checkbox(
|
| 548 |
-
label="
|
| 549 |
-
value=True
|
| 550 |
-
info="Automatically send coordination email"
|
| 551 |
)
|
| 552 |
|
| 553 |
with gr.Row():
|
| 554 |
-
submit_btn = gr.Button("
|
| 555 |
-
clear_form_btn = gr.Button("
|
| 556 |
|
| 557 |
with gr.Row():
|
| 558 |
-
report_btn = gr.Button("
|
| 559 |
-
clear_btn = gr.Button("
|
| 560 |
-
stats_btn = gr.Button("
|
| 561 |
|
| 562 |
status_display = gr.Textbox(
|
| 563 |
label="System Status",
|
|
@@ -576,8 +566,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="AI Coordination System") as ui:
|
|
| 576 |
output = gr.Textbox(
|
| 577 |
label="Coordination Analysis & Actions",
|
| 578 |
lines=18,
|
| 579 |
-
show_copy_button=True
|
| 580 |
-
max_lines=20
|
| 581 |
)
|
| 582 |
|
| 583 |
with gr.Accordion("π’ Department Information", open=True):
|
|
@@ -586,8 +575,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="AI Coordination System") as ui:
|
|
| 586 |
with gr.Accordion("π Recent Coordination Activities", open=False):
|
| 587 |
history_display = gr.JSON(
|
| 588 |
label="Activity Log",
|
| 589 |
-
value=conversation_history[-10:] if conversation_history else []
|
| 590 |
-
every=2
|
| 591 |
)
|
| 592 |
|
| 593 |
# Event handlers
|
|
|
|
| 484 |
email_input = gr.Textbox(
|
| 485 |
label="Administration Report Email",
|
| 486 |
value=get_current_email,
|
| 487 |
+
placeholder="admin@company.com"
|
|
|
|
| 488 |
)
|
| 489 |
email_status = gr.Textbox(
|
| 490 |
label="Email Status",
|
|
|
|
| 492 |
interactive=False,
|
| 493 |
max_lines=2
|
| 494 |
)
|
| 495 |
+
update_email_btn = gr.Button("Update Email", variant="primary")
|
| 496 |
|
| 497 |
gr.Markdown("---")
|
| 498 |
gr.Markdown("### π€ Coordination Request Form")
|
|
|
|
| 501 |
gr.Markdown("#### Personal Information")
|
| 502 |
name_input = gr.Textbox(
|
| 503 |
label="Your Full Name",
|
| 504 |
+
placeholder="Enter your full name"
|
|
|
|
| 505 |
)
|
| 506 |
|
| 507 |
department_dropdown = gr.Dropdown(
|
| 508 |
choices=["administration", "production", "magazine"],
|
| 509 |
+
label="Your Department"
|
|
|
|
| 510 |
)
|
| 511 |
|
| 512 |
with gr.Group():
|
|
|
|
| 514 |
message_input = gr.Textbox(
|
| 515 |
label="Coordination Message",
|
| 516 |
lines=4,
|
| 517 |
+
placeholder="Describe what you need from other departments..."
|
|
|
|
|
|
|
| 518 |
)
|
| 519 |
|
| 520 |
image_input = gr.Image(
|
| 521 |
+
label="Attach Image (Optional)",
|
| 522 |
+
type="pil"
|
|
|
|
|
|
|
| 523 |
)
|
| 524 |
|
| 525 |
with gr.Group():
|
| 526 |
gr.Markdown("#### Email Options")
|
| 527 |
recipient_dropdown = gr.Dropdown(
|
| 528 |
choices=["administration", "production", "magazine"],
|
| 529 |
+
label="Recipient Department"
|
|
|
|
| 530 |
)
|
| 531 |
|
| 532 |
urgency_dropdown = gr.Dropdown(
|
| 533 |
choices=["Normal", "Medium", "High"],
|
| 534 |
value="Normal",
|
| 535 |
+
label="Urgency Level"
|
|
|
|
| 536 |
)
|
| 537 |
|
| 538 |
send_email_checkbox = gr.Checkbox(
|
| 539 |
+
label="Send email to recipient department",
|
| 540 |
+
value=True
|
|
|
|
| 541 |
)
|
| 542 |
|
| 543 |
with gr.Row():
|
| 544 |
+
submit_btn = gr.Button("Submit Coordination Request", variant="primary")
|
| 545 |
+
clear_form_btn = gr.Button("Clear Form", variant="secondary")
|
| 546 |
|
| 547 |
with gr.Row():
|
| 548 |
+
report_btn = gr.Button("Submit & Send Report", variant="secondary")
|
| 549 |
+
clear_btn = gr.Button("Clear History", variant="stop")
|
| 550 |
+
stats_btn = gr.Button("Get Stats")
|
| 551 |
|
| 552 |
status_display = gr.Textbox(
|
| 553 |
label="System Status",
|
|
|
|
| 566 |
output = gr.Textbox(
|
| 567 |
label="Coordination Analysis & Actions",
|
| 568 |
lines=18,
|
| 569 |
+
show_copy_button=True
|
|
|
|
| 570 |
)
|
| 571 |
|
| 572 |
with gr.Accordion("π’ Department Information", open=True):
|
|
|
|
| 575 |
with gr.Accordion("π Recent Coordination Activities", open=False):
|
| 576 |
history_display = gr.JSON(
|
| 577 |
label="Activity Log",
|
| 578 |
+
value=conversation_history[-10:] if conversation_history else []
|
|
|
|
| 579 |
)
|
| 580 |
|
| 581 |
# Event handlers
|