|
import gradio as gr |
|
from datetime import datetime, timedelta |
|
|
|
def generate_release_notes(github_url, github_token, gemini_api_key, start_date, end_date): |
|
|
|
|
|
return f"Generated release notes would appear here. Start Date: {start_date}, End Date: {end_date}" |
|
|
|
|
|
default_end_date = datetime.now() |
|
default_start_date = default_end_date - timedelta(days=7) |
|
|
|
|
|
iface = gr.Interface( |
|
fn=generate_release_notes, |
|
inputs=[ |
|
gr.Textbox(label="GitHub Repository URL (e.g., https://github.com/MicroHealthLLC/maiko-assistant.git)"), |
|
gr.Textbox(label="GitHub Personal Access Token", type="password"), |
|
gr.Textbox(label="Gemini API Key", type="password"), |
|
gr.Textbox( |
|
label="Start Date", |
|
placeholder="YYYY-MM-DD", |
|
value=default_start_date.strftime("%Y-%m-%d"), |
|
), |
|
gr.Textbox( |
|
label="End Date", |
|
placeholder="YYYY-MM-DD", |
|
value=default_end_date.strftime("%Y-%m-%d"), |
|
) |
|
], |
|
outputs=gr.Textbox(label="Generated Release Notes"), |
|
title="Automated Release Notes Generator", |
|
description="Generate release notes based on GitHub commits using Gemini AI. Enter start and end dates (YYYY-MM-DD) to define the time range for commits.", |
|
allow_flagging="never", |
|
theme="default", |
|
analytics_enabled=False, |
|
) |
|
|
|
|
|
iface.launch() |