Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
from github import Github
|
| 4 |
-
from datetime import datetime
|
| 5 |
import google.generativeai as genai
|
| 6 |
|
| 7 |
def generate_release_notes(github_url, github_token, gemini_api_key, start_date, end_date):
|
|
@@ -29,6 +29,10 @@ def generate_release_notes(github_url, github_token, gemini_api_key, start_date,
|
|
| 29 |
|
| 30 |
return response.text
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
# Create Gradio interface
|
| 33 |
iface = gr.Interface(
|
| 34 |
fn=generate_release_notes,
|
|
@@ -36,12 +40,12 @@ iface = gr.Interface(
|
|
| 36 |
gr.Textbox(label="GitHub Repository URL (e.g., https://github.com/MicroHealthLLC/maiko-assistant.git)"),
|
| 37 |
gr.Textbox(label="GitHub Personal Access Token", type="password"),
|
| 38 |
gr.Textbox(label="Gemini API Key", type="password"),
|
| 39 |
-
gr.DateTime(label="Start Date
|
| 40 |
-
gr.DateTime(label="End Date
|
| 41 |
],
|
| 42 |
outputs=gr.Textbox(label="Generated Release Notes"),
|
| 43 |
title="Automated Release Notes Generator",
|
| 44 |
-
description="Generate release notes based on GitHub commits using Gemini AI."
|
| 45 |
)
|
| 46 |
|
| 47 |
# Launch the app
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
from github import Github
|
| 4 |
+
from datetime import datetime, timedelta
|
| 5 |
import google.generativeai as genai
|
| 6 |
|
| 7 |
def generate_release_notes(github_url, github_token, gemini_api_key, start_date, end_date):
|
|
|
|
| 29 |
|
| 30 |
return response.text
|
| 31 |
|
| 32 |
+
# Set default dates
|
| 33 |
+
default_end_date = datetime.now()
|
| 34 |
+
default_start_date = default_end_date - timedelta(days=7) # One week ago
|
| 35 |
+
|
| 36 |
# Create Gradio interface
|
| 37 |
iface = gr.Interface(
|
| 38 |
fn=generate_release_notes,
|
|
|
|
| 40 |
gr.Textbox(label="GitHub Repository URL (e.g., https://github.com/MicroHealthLLC/maiko-assistant.git)"),
|
| 41 |
gr.Textbox(label="GitHub Personal Access Token", type="password"),
|
| 42 |
gr.Textbox(label="Gemini API Key", type="password"),
|
| 43 |
+
gr.DateTime(label="Start Date (Click to select)", value=default_start_date),
|
| 44 |
+
gr.DateTime(label="End Date (Click to select)", value=default_end_date)
|
| 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. Click on the date fields to select start and end dates."
|
| 49 |
)
|
| 50 |
|
| 51 |
# Launch the app
|