Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from datetime import datetime, timedelta
|
| 3 |
import requests
|
| 4 |
-
from bs4 import BeautifulSoup
|
| 5 |
|
| 6 |
def get_subdirectories(url):
|
| 7 |
response = requests.get(url)
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
subdirectories = [link['href'] for link in links if link['href'].startswith('/docs/gradio/')]
|
| 11 |
return subdirectories
|
| 12 |
|
| 13 |
def generate_release_notes(github_url, github_token, gemini_api_key, start_date, end_date):
|
|
@@ -42,19 +41,13 @@ iface = gr.Interface(
|
|
| 42 |
gr.Textbox(label="GitHub Repository URL (e.g., https://github.com/MicroHealthLLC/maiko-assistant.git)"),
|
| 43 |
gr.Textbox(label="GitHub Personal Access Token", type="password"),
|
| 44 |
gr.Textbox(label="Gemini API Key", type="password"),
|
| 45 |
-
gr.
|
| 46 |
label="Start Date",
|
| 47 |
value=default_start_date.date(),
|
| 48 |
-
type="date",
|
| 49 |
-
interactive=True,
|
| 50 |
-
visible=True
|
| 51 |
),
|
| 52 |
-
gr.
|
| 53 |
label="End Date",
|
| 54 |
value=default_end_date.date(),
|
| 55 |
-
type="date",
|
| 56 |
-
interactive=True,
|
| 57 |
-
visible=True
|
| 58 |
)
|
| 59 |
],
|
| 60 |
outputs=gr.Textbox(label="Generated Release Notes"),
|
|
@@ -62,5 +55,5 @@ iface = gr.Interface(
|
|
| 62 |
description="Generate release notes based on GitHub commits using Gemini AI. Select start and end dates to define the time range for commits."
|
| 63 |
)
|
| 64 |
|
| 65 |
-
# Launch the app
|
| 66 |
-
iface.launch(
|
|
|
|
| 1 |
+
# app.py
|
| 2 |
import gradio as gr
|
| 3 |
from datetime import datetime, timedelta
|
| 4 |
import requests
|
|
|
|
| 5 |
|
| 6 |
def get_subdirectories(url):
|
| 7 |
response = requests.get(url)
|
| 8 |
+
links = response.text.split('<a href="')
|
| 9 |
+
subdirectories = [link.split('"')[0] for link in links if link.startswith('/docs/gradio/')]
|
|
|
|
| 10 |
return subdirectories
|
| 11 |
|
| 12 |
def generate_release_notes(github_url, github_token, gemini_api_key, start_date, end_date):
|
|
|
|
| 41 |
gr.Textbox(label="GitHub Repository URL (e.g., https://github.com/MicroHealthLLC/maiko-assistant.git)"),
|
| 42 |
gr.Textbox(label="GitHub Personal Access Token", type="password"),
|
| 43 |
gr.Textbox(label="Gemini API Key", type="password"),
|
| 44 |
+
gr.Date(
|
| 45 |
label="Start Date",
|
| 46 |
value=default_start_date.date(),
|
|
|
|
|
|
|
|
|
|
| 47 |
),
|
| 48 |
+
gr.Date(
|
| 49 |
label="End Date",
|
| 50 |
value=default_end_date.date(),
|
|
|
|
|
|
|
|
|
|
| 51 |
)
|
| 52 |
],
|
| 53 |
outputs=gr.Textbox(label="Generated Release Notes"),
|
|
|
|
| 55 |
description="Generate release notes based on GitHub commits using Gemini AI. Select start and end dates to define the time range for commits."
|
| 56 |
)
|
| 57 |
|
| 58 |
+
# Launch the app
|
| 59 |
+
iface.launch()
|