Commit
·
13bae54
1
Parent(s):
531ba0a
Revamp Gradio UI and markdown
Browse files
app.py
CHANGED
|
@@ -9,17 +9,55 @@ def respond_to_issue(issue_url, branch_name):
|
|
| 9 |
response = f"Something went wrong: {str(e)}"
|
| 10 |
return response
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
gr.Textbox(label="Branch Name", placeholder="main or dev or feature/xyz")
|
| 17 |
-
],
|
| 18 |
-
outputs=gr.Textbox(label="Agent Response"),
|
| 19 |
-
title="OpenSorus – AI Copilot for Timely Dev Support in GitHub Issues",
|
| 20 |
-
description="Running short on time? Just paste the URL of the issue and let the Agent take care of the rest!",
|
| 21 |
)
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
response = f"Something went wrong: {str(e)}"
|
| 10 |
return response
|
| 11 |
|
| 12 |
+
theme = gr.themes.Soft(
|
| 13 |
+
primary_hue="orange",
|
| 14 |
+
secondary_hue="yellow",
|
| 15 |
+
neutral_hue="zinc",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
)
|
| 17 |
+
with gr.Blocks(title="OpenSorus – AI Maintainer Agent", theme=theme) as demo:
|
| 18 |
+
gr.Markdown("""
|
| 19 |
+
# OpenSorus – AI Maintainer Agent for GitHub Issues
|
| 20 |
|
| 21 |
+
**Reads the issue. Understands your repo. Replies in seconds.**
|
| 22 |
+
|
| 23 |
+
Let OpenSorus handle your first-level triage by autonomously pulling context from your codebase and commenting with a helpful fix/suggestion to help your contributors/customers.
|
| 24 |
+
|
| 25 |
+
**Note**: Please [install the agent](https://github.com/apps/opensorus) in your GitHub for a particular repository before using this tool.
|
| 26 |
+
|
| 27 |
+
- **Quickest way to assign issue to OpenSorus**: Just mention @opensorus in the GitHub issue comments.
|
| 28 |
+
- Alternatively, use this space to assign the issue by pasting the issue URL below & specifying the primary branch name of your codebase (e.g., main, master, etc.).
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
""")
|
| 33 |
+
|
| 34 |
+
with gr.Row():
|
| 35 |
+
|
| 36 |
+
with gr.Column(scale=1):
|
| 37 |
+
issue_url = gr.Textbox(label="🔗 GitHub Issue URL", placeholder="https://github.com/user/repo/issues/123")
|
| 38 |
+
branch_name = gr.Textbox(label="🌿 Branch Name", placeholder="main or dev or feature/xyz")
|
| 39 |
+
|
| 40 |
+
submit_btn = gr.Button("🚀 Run Agent", variant="primary")
|
| 41 |
|
| 42 |
+
with gr.Column(scale=1):
|
| 43 |
+
output_box = gr.Textbox(label="💬 Task Status", placeholder="Waiting for updates from the agent...", lines=6)
|
| 44 |
+
|
| 45 |
+
submit_btn.click(fn=respond_to_issue, inputs=[issue_url, branch_name], outputs=output_box)
|
| 46 |
+
gr.Markdown("""
|
| 47 |
+
---
|
| 48 |
+
|
| 49 |
+
### 🛠 How It Works
|
| 50 |
+
1. [Install OpenSorus](https://github.com/apps/opensorus) as a GitHub App.
|
| 51 |
+
2. Configure the app to have access to your particular repository.
|
| 52 |
+
3. Mention @opensorus in any issue's comments.
|
| 53 |
+
4. Alternatively, use this space to paste the issue URL and specify the branch name (e.g., main, master, etc.).
|
| 54 |
+
5. Click Run Agent and OpenSorus will fetch issue details, read your code, and post a helpful comment.
|
| 55 |
+
|
| 56 |
+
> ### _OpenSorus is just like an L1 dev support assistant of your project that never sleeps — and knows your codebase ✨._
|
| 57 |
+
|
| 58 |
+
---
|
| 59 |
+
|
| 60 |
+
""")
|
| 61 |
+
|
| 62 |
+
if __name__ == "__main__":
|
| 63 |
+
demo.launch()
|