Commit
·
c4a8e5f
1
Parent(s):
450bb0a
Add clear button to clean old requests
Browse files
app.py
CHANGED
|
@@ -27,6 +27,9 @@ theme = gr.themes.Soft(
|
|
| 27 |
primary_hue="orange",
|
| 28 |
secondary_hue="yellow",
|
| 29 |
neutral_hue="zinc",
|
|
|
|
|
|
|
|
|
|
| 30 |
)
|
| 31 |
|
| 32 |
with gr.Blocks(title="OpenSorus – AI Maintainer Agent", theme=theme) as demo:
|
|
@@ -52,7 +55,10 @@ with gr.Blocks(title="OpenSorus – AI Maintainer Agent", theme=theme) as demo:
|
|
| 52 |
with gr.Column(scale=1):
|
| 53 |
issue_url = gr.Textbox(label="🔗 GitHub Issue URL", placeholder="https://github.com/user/repo/issues/123")
|
| 54 |
branch_name = gr.Textbox(label="🌿 Branch Name", placeholder="main or dev or feature/xyz")
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
with gr.Column(scale=1):
|
| 58 |
chatbot = gr.Chatbot(
|
|
@@ -74,6 +80,15 @@ with gr.Blocks(title="OpenSorus – AI Maintainer Agent", theme=theme) as demo:
|
|
| 74 |
queue=True,
|
| 75 |
)
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
gr.Markdown("""
|
| 78 |
---
|
| 79 |
|
|
|
|
| 27 |
primary_hue="orange",
|
| 28 |
secondary_hue="yellow",
|
| 29 |
neutral_hue="zinc",
|
| 30 |
+
).set(
|
| 31 |
+
button_secondary_background_fill_hover='*neutral_100',
|
| 32 |
+
button_secondary_background_fill_hover_dark='*neutral_700',
|
| 33 |
)
|
| 34 |
|
| 35 |
with gr.Blocks(title="OpenSorus – AI Maintainer Agent", theme=theme) as demo:
|
|
|
|
| 55 |
with gr.Column(scale=1):
|
| 56 |
issue_url = gr.Textbox(label="🔗 GitHub Issue URL", placeholder="https://github.com/user/repo/issues/123")
|
| 57 |
branch_name = gr.Textbox(label="🌿 Branch Name", placeholder="main or dev or feature/xyz")
|
| 58 |
+
with gr.Row():
|
| 59 |
+
clear_btn = gr.Button("Clear", variant="secondary")
|
| 60 |
+
submit_btn = gr.Button("Run Agent 🚀", variant="primary")
|
| 61 |
+
|
| 62 |
|
| 63 |
with gr.Column(scale=1):
|
| 64 |
chatbot = gr.Chatbot(
|
|
|
|
| 80 |
queue=True,
|
| 81 |
)
|
| 82 |
|
| 83 |
+
def clear_workspace():
|
| 84 |
+
return gr.update(value=""), gr.update(value=""), []
|
| 85 |
+
|
| 86 |
+
clear_btn.click(
|
| 87 |
+
fn=clear_workspace,
|
| 88 |
+
inputs=[],
|
| 89 |
+
outputs=[issue_url, branch_name, chatbot],
|
| 90 |
+
)
|
| 91 |
+
|
| 92 |
gr.Markdown("""
|
| 93 |
---
|
| 94 |
|