Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,16 @@ import gradio as gr
|
|
2 |
from datetime import datetime, timedelta
|
3 |
|
4 |
def generate_release_notes(github_url, github_token, gemini_api_key, start_date, end_date):
|
5 |
-
#
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
# Your existing function implementation here
|
10 |
# ...
|
@@ -23,28 +30,23 @@ iface = gr.Interface(
|
|
23 |
gr.Textbox(label="Gemini API Key", type="password"),
|
24 |
gr.DateTime(
|
25 |
label="Start Date",
|
26 |
-
value=default_start_date.date()
|
27 |
-
type="
|
28 |
-
include_time=False,
|
29 |
interactive=True,
|
30 |
visible=True
|
31 |
),
|
32 |
gr.DateTime(
|
33 |
label="End Date",
|
34 |
-
value=default_end_date.date()
|
35 |
-
type="
|
36 |
-
include_time=False,
|
37 |
interactive=True,
|
38 |
visible=True
|
39 |
)
|
40 |
],
|
41 |
outputs=gr.Textbox(label="Generated Release Notes"),
|
42 |
title="Automated Release Notes Generator",
|
43 |
-
description="Generate release notes based on GitHub commits using Gemini AI. Select start and end dates to define the time range for commits."
|
44 |
-
allow_flagging="never",
|
45 |
-
theme="default",
|
46 |
-
analytics_enabled=False
|
47 |
)
|
48 |
|
49 |
-
# Launch the app
|
50 |
-
iface.launch()
|
|
|
2 |
from datetime import datetime, timedelta
|
3 |
|
4 |
def generate_release_notes(github_url, github_token, gemini_api_key, start_date, end_date):
|
5 |
+
# Convert start_date and end_date to datetime objects if they're not already
|
6 |
+
if isinstance(start_date, str):
|
7 |
+
start_date = datetime.fromisoformat(start_date).date()
|
8 |
+
elif isinstance(start_date, datetime):
|
9 |
+
start_date = start_date.date()
|
10 |
+
|
11 |
+
if isinstance(end_date, str):
|
12 |
+
end_date = datetime.fromisoformat(end_date).date()
|
13 |
+
elif isinstance(end_date, datetime):
|
14 |
+
end_date = end_date.date()
|
15 |
|
16 |
# Your existing function implementation here
|
17 |
# ...
|
|
|
30 |
gr.Textbox(label="Gemini API Key", type="password"),
|
31 |
gr.DateTime(
|
32 |
label="Start Date",
|
33 |
+
value=default_start_date.date(),
|
34 |
+
type="date",
|
|
|
35 |
interactive=True,
|
36 |
visible=True
|
37 |
),
|
38 |
gr.DateTime(
|
39 |
label="End Date",
|
40 |
+
value=default_end_date.date(),
|
41 |
+
type="date",
|
|
|
42 |
interactive=True,
|
43 |
visible=True
|
44 |
)
|
45 |
],
|
46 |
outputs=gr.Textbox(label="Generated Release Notes"),
|
47 |
title="Automated Release Notes Generator",
|
48 |
+
description="Generate release notes based on GitHub commits using Gemini AI. Select start and end dates to define the time range for commits."
|
|
|
|
|
|
|
49 |
)
|
50 |
|
51 |
+
# Launch the app with a public link
|
52 |
+
iface.launch(share=True)
|